.status-msg-wrap { display: none; }
Monday, April 30, 2018
no image

More advanced Proper Case?

Is there a more advanced Proper Case function or Nuget package I might be able to use to handle things like this: COMPANY LLC -> Company LLC o'riely -> O'Riely HOWARD-MACK -> Howard-Mack

Or even to recognize common or "every day" acronyms like: gmc -> GMC inc -> INC

More advanced Proper Case? Click here
no image

One Class...

As background, I'm a Solutions Architect that's worked with .NET (mostly around SharePoint customization) for years, but the last 3-4 years due to projects have been more focused around SQL Server / BI tools (SSAS, SSIS, etc.).

I've been asked to join an existing team that's struggling a bit in-house with a critical project that's been going for the last 1-2 years but is in a rut. As part of that I'll be looking at overall design and dev processes (no problem there), but also helping in the development. I'm not going to lie, I'm actually a little nervous given my absence from core .NET dev for the last few years.

I've picked up a newer model MVC book and that's come back to me (the new EF and MVC tools in Visual Studio are insane, definitely a lot easier now). However, there's a lot I'm out of the loop on - new features of MVC 5, I haven't done anything w/ Angular, etc.

If you had the ability to take one class (online / online live - I don't think I'm getting a travel budget lol) for someone with old but high experience with .NET and c# to ramp up on newer technologies / patterns with .NET dev, what would you recommend? I'm checking out stuff from New Horizons (MS official curriculum), and there's a few that look like they would fit the bill as a ramp-up.

Are there any you would recommend? Thanks in advance!

One Class... Click here
no image

Looking for a .Net dev with experience on WinApis for a new product

Hello everybody

I am trying to create a new product that requires running a process as another user (logged in user).

Looking particularly for folks who have worked on Windows Sessions, tokens and understands UAC and windows security.

Pls PM me if any one is interested.

Thank you!

Looking for a .Net dev with experience on WinApis for a new product Click here
no image

Why you guys love C# and do you feel the language as become bloated ?

1) Why you guys love C# over another language ? (like C++, Java, Javascript, Python etc)

2) Do you guys feel the language as become slowly bloated with time ?

3) Is it possible to not make a language bloated "or a mess" with the addition of new librairies, new features, or extending a standard like C++ did... ? by bloat I mean syntax wize too.. like many programmers complains about the way the syntax look in C++ template for example ...

4) Do you guys think the language will keep evolving fast ?

Why you guys love C# and do you feel the language as become bloated ? Click here
no image

How to consume a Web API from a MVC/Razor Page web app?

I can understand that I will be able to use HttpClient to interact with the API and transact data but what I don't understand is how JWT authentication will work as, if I am not wrong, server side MVC/Razor Pages cannot access local storage of client.

And please don't tell me to use Angular/React/Vue or other client only stuffs. I need to know this because of a reason, if I had the choice of switching to a SPA app, I would've.

How to consume a Web API from a MVC/Razor Page web app? Click here
Sunday, April 29, 2018
no image

Manage Connections to Database on Local Network Server

I am currently developing an application using code first Entity Framework. Right now I have the application working perfectly fine on a local machine. What I am wanting to do next is to be able to move that database to a network server, and allow multiple users to access the database at the same time.

In trying to figure out the best way to approach this, so far my Google game is lacking. So far the only suggestion I have found is to use WCF, but the material I have found on that relates mostly to web when I am only wanting this to be accessible from a local network standpoint.

So, what I am wanting to know is what do you guys suggest as the best solution? Is WCF the way to go, or is there something better? This is a fairly simple app, I'm not needing anything fancy, just something straightforward, and gets the job done. If you have links to any good resources that would also be greatly appreciated.

Manage Connections to Database on Local Network Server Click here
no image

.NET Core API sending broadcasts to connected apps

Hi all.

I'm looking into options for sending location data between an Android app and a .NET Core Web API at a predefined rate (say, every 10 minutes).

At the moment it's working via Android Foreground Services by sending the location to a API endpoint - but that all changes in Android 8.0 and becomes unreliable.

I'm wondering if a better way to do this would be to get the API to broadcast a ping to every mobile device that is currently tracking, and ask for a location report. If they do not receive a location back within a specific timeframe, then the tracking session could be considered terminated.

Has anyone done something similar? I'm currently looking at https://firebase.google.com/docs/cloud-messaging/ to do this.

Thank you.

.NET Core API sending broadcasts to connected apps Click here
no image

What do people typically call the layer between a Service and a ViewModel?

Hello there,

I am trying to design an MVVM app and failing :|

When I started out writing it, I more or less had 4 layers.

Model, Service, ViewModel and view.

My current sticking point is, what excactly is a service? From the googling I have done so far, I don't think there is a consensus. Some people say that a Service class should be stateless. Which is fine. But, if so, where do I put all my classes that need a state?

I have a read a few posts on stackoverflow that suggest an intermediate layer might be something like DomainLogic, or BusinessLogic..

Should I even care about making the distinction? Should I just jam it all in and call it a service layer?

I know it all depends on the application (it is a trading app), but I would be interested in hearing thoughts on what people think.

Thank you kindly

What do people typically call the layer between a Service and a ViewModel? Click here
no image

I'm trying to build a REST API in dotnet core, having lots of issues.

Hi everyone, I hope you allow dotnet core questions here. I apologize if not.

Basically, I want to build an application that utilizes REST APIs but I'm having a lot of issues trying this in dotnet core. My biggest issue is finding a compatible HTTP Framework to allow this (I'm really trying to avoid MVC and go client/server). I played around with Nancy/Nancy Self Host and even with its 2.0 release, I can't get the application to server without errors being thrown (reservations issues).

Does anyone have an idea whether or not this is possible? I really wanted to learn the ways of dotnet core but now it is beginning to look impossible. Is dotnet core much less sophisticated than I am thinking?

Thanks for your help!

I'm trying to build a REST API in dotnet core, having lots of issues. Click here
no image

Correct way of measuring HTTP response using .Net?

I’m using the below syntax in Powershell to give an estimate of the HTTP response time for the request. I’m not looking for bang on timing but at least to the second.

[System.Diagnostics.Stopwatch]::StartNew();Invoke-WebRequest -Uri $URI;[System.Diagnostics.Stopwatch]::StartNew().Stop();[System.Diagnostics.Stopwatch]::StartNew().Stop().Elapsed

Is the above a reasonable counter for nanoseconds/seconds taken?

Correct way of measuring HTTP response using .Net? Click here
no image

Code Contracts on .NET Core

I'd really like to add argument guards all over my code where if a passed parameter is null you check and throw an argument exception. This is a very common pattern. I've been reading about code contracts and it seems much cleaner to use them but it looks like the project is dead. What do you use to accomplish what I'm trying to do? I looked at fluent assertions which looks very slick but people say not to use it in production. I strongly prefer something Microsoft blessed or something with a large community support which makes me not want to use the null guard project.

Is there a plugin like resharper that will add these checks?

This is the article on code contracts https://visualstudiomagazine.com/articles/2017/04/01/reconsider-using-contracts.aspx?m=1

I also found this https://github.com/Fody/NullGuard

*EDIT I also want to be able to check all of the properties on a passed object for sane values. I'd like to not have 10 if not null checks I have to write. Fluent assertions makes this clean.

Code Contracts on .NET Core Click here
no image

Making an Windows alias for a dotnet core application

Hi,

I would like to make a persistent alias for a dotnet core dll on Windows.

I have a dotnet core application where I have run the 'dotnet publish' command. This has given me a set of dlls. I've copied these dlls into a subdirectory under 'C:\tools\App' and now I would like to make an alias so I can run the application any time.

Within a unix environment I would add the following to my .bash_profile: alias app='dotnet C:\tools\App\Application.dll'

After doing some research it looks like you can use the doskey command however it only lasts for your current cmd session. What is the recommended approach when dealing with this kind of problem for dotnet core?

Thanks

Making an Windows alias for a dotnet core application Click here
Saturday, April 28, 2018
no image

[.NET Core] Why does Identity always creates cookies even when using JWT as default authentication scheme?

Pardon me if this comes as noobish but I am learning .NET Core and since everyone I know suggested to use JWT for authentication, I decided to go with it. However, I am utterly confused as to why Identity always creates a cookie regardless of the type of authentication I choose. And when checking for current user (authenticated) it goes with the cookie and ignoring the Authorization Bearer header. I have set JWT as default authentication in Startup like this:

services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { options.SaveToken = true; options.TokenValidationParameters = new TokenValidationParameters { ClockSkew = TimeSpan.Zero, ValidateIssuer = true, ValidateAudience = true, ValidateLifetime = true, ValidateIssuerSigningKey = true, ValidIssuer = Configuration["Jwt:Issuer"], ValidAudience = Configuration["Jwt:Audience"], IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["Jwt:Key"])) }; }); 

What am I doing wrong?

[.NET Core] Why does Identity always creates cookies even when using JWT as default authentication scheme? Click here
Friday, April 27, 2018
no image

Question about Roslyn and references

So I've been working on a program that uses Roslyn to find hardcoded SQL queries. Right now it's just a console app, but I plan on creating a UI for it so I moved all the Roslyn stuff into a class library, added the Roslyn packages to it, and removed them from the console app. However it completely blew up in my face until I added all the same packages back to the console app. Am I doing something wrong or is that just how it works?

Question about Roslyn and references Click here
no image

DataGridView doens't drag for me. Works for everyone else.

I have a commercial application that displays a data table in a DataGridView.

The application allows you to reorder the rows to reorganize the information. It works for everyone else in the world except me.

For some reasons which the vendor nor I can figure out, attempting to drag the row to move it simply treats the row header as yet another cell for range selection and does not intiate a drag action.

What might be going on here? Is there some system-wide property that may have been accidentally set? Is there even such a thing?

DataGridView doens't drag for me. Works for everyone else. Click here
no image

How to resize a datagrid column when datagrid resizes in wpf?

Would post this on SO, but I'll be honest I am scared of that community. Feel safer around.

Anyways, I have an MVVM WPF application that has a datagrid within a user control. That user control is within a tab. I would like the first column take up as much room as possible (Width="*") and the rest take whatever. Usually the star would take care of this problem. However, I am not sure what I am doing wrong, but doing so crops the entire column out as if the grid had no width. The solution I was using then was to give the column a MinWidth, but that just does not sit right with me; and the other issue being that if the grid or form changes size, none of the data grid columns resize. The user also cannot resize the columns either, though it displays the double arrowhead. I tried a lot of things: setting ColumnWidth="*" in the data grid tag, setting Width="auto", and then even resizing on the loaded/resize events from code behind. Nothing is working and it is really starting to become obnoxious.

Link of what I tried with code behind: https://stackoverflow.com/questions/4997596/how-can-i-set-the-width-of-a-datagridcolumn-to-fit-contents-auto-but-comple

this is what is in the user control:

 <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <DataGrid Grid.Row="0" AutoGenerateColumns="False" ItemsSource="{Bindingtems}" SelectionMode="Single" ColumnWidth="*" SelectedItem="{Binding SelectedLine}"> <DataGrid.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="{StaticResource SelectedDataGridItemBackgroundColor}"/> </DataGrid.Resources> <DataGrid.Columns> <DataGridTextColumn Header="Item Description" Width="*" Binding="{Binding Description, UpdateSourceTrigger=PropertyChanged}"/> <DataGridTextColumn Header="Quantity" MinWidth="100" Binding="{Binding Quantity, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> <DataGridTextColumn Header="Total" MinWidth="100" Binding="{Binding LineBillingTotal, UpdateSourceTrigger=PropertyChanged, StringFormat='{}{0:c}'}"/> </DataGrid.Columns> </DataGrid> </Grid> 

Tab Item where the grid is:

<TabItem.ContentTemplate > <DataTemplate > <local:DetailView DataContext="{Binding Source={StaticResource Locator}, Path=Detail}" /> </DataTemplate> </TabItem.ContentTemplate> 
How to resize a datagrid column when datagrid resizes in wpf? Click here
Thursday, April 26, 2018
no image

Searching using EF

I have entities in my database that I want to return all objects into a list that meet criteria determines by the user. Lets say theres 10 properties I want the user to be able to put criteria in for... I obviously don't write all possible permutations of those search criteria... How do I use EF to pass a partially completed object and find all entities who have matching properties? If some of this properties are ints and bools, I would imagine I would have to create a version of that class and change them to int? and bool? so it doesn't look for 0's and Falses if no criteria is put in the search field?

Searching using EF Click here
no image

AWS S3 with .net

Hey guys, I want to be able to encrypt my s3 bucket with AES256 programmitcally but it doesnt seem to be working. I have tried many ways but still stuck. Please help if possible thank you! Here is my code:

 PutBucketRequest putBucketRequest = new PutBucketRequest { BucketName = "test0456-dev", BucketRegion = S3Region.USE1 }; PutBucketResponse putBucketResponse = amazons3.PutBucket(putBucketRequest); PutBucketEncryptionRequest putBucketEncryptionRequest = new PutBucketEncryptionRequest { BucketName = "test0456-dev", }; ServerSideEncryptionByDefault serverSideEncryptionByDefault = new ServerSideEncryptionByDefault { ServerSideEncryptionAlgorithm = "AES256" }; List<ServerSideEncryptionRule> ServerSideEncryptionRule = new List<ServerSideEncryptionRule> { new ServerSideEncryptionRule { ServerSideEncryptionByDefault = serverSideEncryptionByDefault } }; 
AWS S3 with .net Click here
no image

How do you structure your learning?

I’m a jr .NET developer. I try to study for about an hour most evenings during the week but I sometimes feel a little overwhelmed at how much there is to learn.

I was just wondering how anyone here has tackled self-learning at home whilst working as a developer full time.

Do you pick a topic and study for a while before moving on to another? Do you do a few different things at once?

Any advice would be awesome a list of topics I’m focusing on

How do you structure your learning? Click here
no image

Future of Razor Pages

I recently tried out Razor Pages and even though I heard nothing but criticisms, I am thoroughly impressed by how intuitive and amazing they are. One of the vital criticism I heard was that Razor Page is essentially WebForm 2.0 and it destroys the ideology of separation of concerns. This is completely bs, and I realized it after using it extensively on a few projects. I am currently in love with Razor Pages and already transferred a few of my MVC projects to Razor Pages.

However, given the huge negative back-lash that the community has given, I am afraid of its future. I don't know about you, but I will suggest you to at least give it a try before riding the hate train. Regardless, I am concerned as to whether Microsoft will continue to support this as the general feedback appears to lean heavily on the negative side.

Future of Razor Pages Click here
no image

Need counsel and bit of guidance career

Hi Guys,

So this question is more for developers/IT based out of India. So I am a Senior .Net developer with 10 Exp during with 6 yrs I spent on dotner and Java based Internet banking products. Recently I have started working on a dotnet based enterprise CMS which was in demand and I needed the moolah/bugs to pay the bills(note : got married)

I am now working in product support ,development of a enterpise LOB webiste build on angular , dotnet core (the latest and greatest) , but I severely confused if this is the place I want to be in. There is also the question of career progression , layoffs, hikes .

I hope you guys could help me what I should do to advance my career ? 1- Should I switch careers and jump ship to Product owner , SCRUM , Machine learning fields. 2- What are my other options in senior .net developer/lead engineer in terms of skills development and growth.

Sorry for the long post. No potato here :)

Need counsel and bit of guidance career Click here
no image

MVVM Messenger Pattern. How does it work?

Hello there,

I am trying to understand how to implement a messenger in my MVVM application.

The framework I am using is DevExpress's MVVM Framework, which includes a messenger which can be used for passing and subscribing to messages between objects. I presume MVVMLight, Prism, etc all do/have much the same thing.

I am trying to figure out exactly how one goes about making something work using messenging.

Lets take for example. The process of placing an order via a website API. In my application, I have two objects. One that keeps track of the session and webAPI functions. One that knows about orders on a local system.

If I was to do it in a coupled way. I would instantiate on my OrderObject an APIObject and run a method from there...something like APIObject.PlaceOrder...and that method would return a value of success or failure. My OrderObject would then continue on its way, knowing if there was successful ordering or not....

In a messenging bus pattern, or an uncoupled way. I wonder how to achieve the same thing. I presume that in the OrderObject I would send a message that an order is ready to be placed..... The APIObject would be listening to the messagebus for new orders and place an order according to the message when it comes.

How then does the OrderObject know whether the order was successful or not? It doesn;t know about APIObject? And how does it know when to resume processing?

On a side note, if anyone could tell me what the most commonly used pattern name for a Messenger like devexpress'? Is it a mediator, observer, or some other named pattern?

I'd be very appreciative if anyone could offer any advice? Thank you

MVVM Messenger Pattern. How does it work? Click here
Wednesday, April 25, 2018
no image

nested foreach loops for List properties

OK, I have a list of objects, whose properties include a list of another type of object. let's call it List<Quote> Quotes, and the Quote object has a property List<Item> Items.

I'm trying to show these items with a foreach loop...

@foreach(var quote in Quotes)

{

<div class="row">

//Some content for each property and

@foreach(var item in quote.Items)

{

//some content for each item within the Items list

}

</div>

}

I'm getting this super strange error

Blurred out some identifiable information.

When I take out that second foreach loop and "test" in it's place, the error goes away and the page renders no problem.

Can you not put a foreach loop for a list property inside a foreach loop for a list?

nested foreach loops for List properties Click here
no image

Convert raw HTML to PDF on Azure

Hello everyone,

For one of my application, I have to convert raw HTML to PDF file and make the user download it. The application is hosted in Azure.

I'm currently using the free version of NReco.PdfGenerator and it worked well for what I need.

But that library doesn't work with HTML5/CSS3.

So I'm looking for another free library that can replace it. Something simple, I don't need a strong library with a lot of utilities, only a simple one able to do Library.Converter(html).

I wanted to try "whhtmltopdf", with Codaxy.WkHtmlToPdf or Pechkin wrapper but it seems the executable can't work on Azure. I saw other threads saying to use a webjob to run the .exe, but the problem lie in the fact that whhtmltopdf does operations forbidden in Azure, and I believe that it will not work with a webjob either.

I'm also using iTextSharp for other stuff. Could it work for my needs (like I said, HTML5/CSS3)?

tl;dr: Can someone lead me to a free solution to convert raw HTML (HTML5/CSS3) to a PDF file in an Azure app?

Convert raw HTML to PDF on Azure Click here
no image

Question on my 1st Windows Application in C#

I wrote a simple tool in VB6 many moons ago. And decided to get my feet wet in C# .NET by recreating said tool. Only, 5 min in i'm stuck.... I simply am trying to fire an event when someone clicks a textbox on my form.

private void textBox1_Click(object sender, EventArgs e) { MessageBox.Show("test"); }

This event wont fire for some reason.

Question on my 1st Windows Application in C# Click here
no image

C# - Pass through result of dataset query to label text

New to datasets, I am able to use queries in the table adapter to fill out items like lists and dropdowns, but I have a query that will only ever return 1 row, and looking to put the text of a particular column in that row into a label so far my attempts have only returned the column name. Anyone know what I am missing?

var ta = new MyDataTableAdapters.MyTableAdapter(); var rates = new MyData.MyDataTable(); ta.FillBywxyz(rates, w, x, y, z); Label.Text = rates.MinRateColumn.ToString(); 

Any Insight would be appreciated!

C# - Pass through result of dataset query to label text Click here
Tuesday, April 24, 2018
no image

Issue with getting azure asp.net mvc core site to work with Azure Active Directory

On my local machine, I've created an application that ties into an organization's AD. I'm able to authenticate against it when I develop locally.

However, when I deploy the application, I'm getting the following error.

AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application:

Where do I need to go to fix this? Should I fix this in Azure or in my application?

Issue with getting azure asp.net mvc core site to work with Azure Active Directory Click here
no image

Looking for a specific talk by Scott Hanselman

Hi there! I remember a while back I saw a video where Scott Hanselman sort of explained the web/development for a "non-web" developer. I can't for the life of me find it because I can't remember the details precisely but hopefully someone else knows what I'm looking for and might have a link to it :).

Looking for a specific talk by Scott Hanselman Click here
Monday, April 23, 2018
The webdev Team