Dapper One To Many Relationship

I have 3 tables structured in the following way: CREATE TABLE [User]( Id int NOT NULL, Name varchar(50) PRIMARY KEY (Id) ) CREATE TABLE [Role]( Id int NOT NULL, UserId int NOT NULL, Name varchar(50), PRIMARY KEY (Id), ...
more »

2017-12-01 23:12 (1) Answers

Null Check Operator still returns a null value

I'm trying to get all of the generic service from my dependency injector who implement a type protected List<ServiceDescriptor> GetGenericServicesFromGenericTypeDefinition(IServiceCollection services, Type baseGenericTypeDefinition) { if...
more »

2017-12-01 14:12 (2) Answers

Adding dependency as DLL or adding as a project

We have an application written in asp.net mvc. Now we have written common db context & entities module (2 projects/class library) which are required by this application. Same db context and entities would also be required /part of another appli...
more »

2017-11-29 19:11 (3) Answers

How to Unit Test Startup.cs in .NET Core

How do people go about Unit Testing their Startup.cs classes in a .NET Core 2 application? All of the functionality seems to be provided by Static extensions methods which aren't mockable? If you take this ConfigureServices method for example: publ...
more »

2017-11-25 04:11 (1) Answers

.Net Core Web API

New to .NET Core. What am I doing wrong? Here is my controller [Route("api/[controller]")] public class customerController : Controller { // GET: api/values //[HttpGet] //public IEnumerable<string> Get() //{ // return ...
more »

2017-11-25 00:11 (1) Answers

.net core injecting and resolving services

I am trying my hand at .net core web api. I have created a static method for registering my controllers like this: public static class RegistrationExtensions { public static void RegisterApplicationServices(this IServiceCollection services, ISer...
more »

2017-11-24 16:11 (3) Answers

.NET CORE 2 EF Include

I am using new .net core and EF. I need help with include linq command. I have some 1:N models and if the collection contais some data marked like deleted I do not want to include them. How to do it? var company = await _context.Company ...
more »

2017-11-22 18:11 (2) Answers

ASP NET MVC Core 2 Roles without database

I'm using Active Directory to manage my users and their respective roles, both of these are correctly brought back. I am then trying to assign the roles through ClaimsIdentity.AddClaim(new Claim(ClaimsType.Role, user.Role)); when debugging I can see...
more »

2017-11-20 16:11 (0) Answers

Migrating ASP.NET Core, Kestrel and IIS Features

I am trying to figure out ASP.Net Core applications and Kestrel web server behind them. So, I read some articles about ASP.Net Core and I realized that using self-hosted ASP.NET MVC projects are more maintainable instead of using IIS environment dir...
more »

2017-11-15 10:11 (0) Answers

ASP .NET Core app and myBB forum on one server?

I want to buy VPS (Debian/Ubuntu) and host my ASP .NET Core app and myBB forum on this machine. How can I configure Apache ( and everything what is needed ) to get something like this: mydomain.com targets ASP .NET app mydomain.com/forum or forum....
more »

2017-11-12 21:11 (2) Answers

How to Upgrade to ASP.NET Core 2.0

I have an ASP.NET Core project. It is .NET Framework based. I have been working with .NET Version 4.6, but am happy to upgrade to 4.6.2 or 4.7. I have both installed on my machine. The referenced NuGet packages are numerous and version numbers varied...
more »

2017-11-09 00:11 (1) Answers