Data dodania Pytanie
2018-02-14 15:02 Audit trail with Entity Framework Core »
I have an ASP.NET core 2.0 using Entity Framework core on a SQL Server db. I have to trace and audit all the stuff made by the users on the data. My ...
(2) odpowiedzi
2018-02-10 06:02 Get users last accessed time »
I am using IdentityServer 4 (with sql storage) for my asp.net core API. I would like to add a "Last Accessed" field somewhere in the database that ca...
(1) odpowiedzi
2018-02-09 20:02 Avoid 'Discriminator' with AspNetUsers, AspNetRoles, & AspNetUserRoles »
I am extending IdentityUser, IdentityUserRole, and IdentityRole like this: public class ApplicationUser : IdentityUser { public string FullName {...
(1) odpowiedzi
2018-02-05 14:02 How to load navigation properties on an IdentityUser with UserManager »
I've extended IdentityUser to include a navigation property for the user's address, however when getting the user with UserManager.FindByEmailAsync, t...
(2) odpowiedzi
2018-02-05 13:02 Entity framework core, code first migration with data migration »
I am trying to use EF Core code first migrations to de-normalise an existing table. I have en existing table LoginEvent which data looks like this: ...
(1) odpowiedzi
2018-02-04 20:02 Asp.Net Core Identity - Using a stored procedure to save new users »
I see a lot of information on ASP.Net Core Identity and have been piecing together how to customize it, since I am building a site for use against an ...
(2) odpowiedzi
2018-02-03 06:02 How to remove a particular migration in Entity Framework Core 2.0? »
I have added around 100 migrations using Add-Migration in Package Manager Console and run Update-DataBase. Now I want to remove let's say 56th number ...
(1) odpowiedzi
2018-02-01 15:02 How to convert from DbDataReader to Task<IEnumerable<TEntity>> in Entity Framework Core 2.0? »
I'm calling a Stored Procedure in EF Core 2.0 in the following way. private async Task<IEnumerable<TEntity>> InvokeStoredProcedureAsync(s...
(3) odpowiedzi
2018-02-01 03:02 EF Core: Get Authenticated username in Shadow Properties »
As a part of logging who entered/updated the data I am adding 4 common fields (Created By, Created Date, Modified By, Modified Date) in all entities. ...
(1) odpowiedzi
2018-01-30 15:01 Incorrect syntax near 'MERGE' Entity Framework Core »
I have a problem when try to create a client, who has a few addresses. public class Client { public int Id { get; set; } public string Name{ ...
(1) odpowiedzi
2018-01-24 16:01 Trying to put json into raw sql query and getting "Input string was not in a correct format" »
So, I using postgresql and need to update some 'jsonb' field and trying to do this with plain sql query, but it's a bit tricky when I trying to make t...
(0) odpowiedzi
2018-01-20 21:01 EF Core 2.0: Determine which PropertyInfos of a generic TEntity are primary keys via reflection »
I am writing a MySQL INSERT ... ON DUPLICATE KEY UPDATE implementation via a raw SQL command in EF Core 2.0. I am very close to a working solution, bu...
(1) odpowiedzi
2018-01-20 18:01 EF Core - adding/updating entity and adding/updating/removing child entities in one request »
I am struggling with what seemed to be a couple of basic operations. Let's say I've got a class named Master: public class Master { public Maste...
(1) odpowiedzi
2018-01-06 20:01 Can't create an instance of the DbContext in AspNetCore 2.0 application using DI for options »
According to the docs I'm supposed to use the following statement to access my data in the DB (which always works great when using the non-DI based co...
(2) odpowiedzi
2017-12-31 11:12 Dynamically access table in EF Core 2.0 »
I am using System.Linq.Dynamic.Core to dynamically add in lambda expressions to queries in EF. I want to also be able to select the table by name. I ...
(1) odpowiedzi
2017-12-29 06:12 What automatically causes EF Core to include Collection properties? »
I have this class: public class Subject { public int Id { get; set; } [Required] [StringLength(50)] public string Name { get; set; }...
(1) odpowiedzi
2017-12-27 16:12 how to debug dotnet ef database drop? »
On Running dotnet ef database drop I get an error. How can I debug this command, to get more details about the problem? Or how can I find the source o...
(1) odpowiedzi
2017-12-22 22:12 Running Ef core migration on the server »
Does any know how to run EF core command on a server with VS 2017. I have SDK 2.0.3 installed on the server. I ran this command from source code f...
(1) odpowiedzi
2017-12-20 16:12 Entity Framework Core Respository Pattern - Duplication Check »
I am trying to work out a solution to check if any fields that should not be duplicated are having a row added that would break this rule. I am using ...
(1) odpowiedzi
2017-12-19 19:12 Change logging level of SQL queries logged by Entity Framework Core »
Entity Framework core by default logs all executed SQL queries to the ASP.NET Core logger (Microsoft.Extensions.Logging). The default log level is Inf...
(0) odpowiedzi
2017-12-18 16:12 How to order by 1 expression or 2 expressions based on a condition? »
I am displaying businesses and people in a single result and would like to order them together. Pseudocode: if business name is not null order by bu...
(2) odpowiedzi
2017-12-10 16:12 Transactional Integration Testing ASP.Net Core and Entity Framework Core »
I’m curious if anyone has gone down the road of transactional integration testing with aspnet and ef core? I want to be able to perform full integra...
(0) odpowiedzi
2017-12-09 12:12 How to define multiple relationships between two entities? »
I have the scenario where a user can upload multiple photos (One-to-Many). The user also can have a default photo (One-to-One). However, I entity fram...
(1) odpowiedzi
2017-12-06 20:12 CRUD operations on many to many relationship using entity framework core 2.0 code first »
I have many to many relationship between computer and User. Unfortunately, there are not many examples of CRUD operations on many-to-many relationship...
(2) odpowiedzi
2017-12-03 08:12 Entity Framework Core: remove a relationship but not delete the entities »
How would you delete a relationship assuming you had the 2 entities, but did not have the 'relationship' entity? Assuming the following entities... ...
(1) odpowiedzi
2017-11-25 09:11 Using EF Core HasQueryFilter on navigation properties »
I'm trying to apply a filter to my queries for multi-tenancy but it doesn't allow me to apply the filter when the property is part of a navigation pro...
(2) odpowiedzi
2017-11-22 18:11 .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 de...
(2) odpowiedzi
2017-11-22 18:11 Access to DbContext with dependency injection »
I don't understand the official documentation, at the paragraph about dependency injection. They say I can use a controller (but from here I know I d...
(2) odpowiedzi
2017-11-19 23:11 Entity framework Core : property setter is never called (Violation of encapsulation?) »
In both EF Core and EF6, invoking the getter of the property 'Date' (see below) gives the correct value, however notice the slight difference between ...
(1) odpowiedzi
2017-11-19 21:11 Why is asp.net core logging not filtering by categories that begin with? »
I'm using EF Core and it logs quite a few "info" level messages on application start that I want to filter out. The docs imply that a filtering rule s...
(1) odpowiedzi
2017-11-18 09:11 Exception when comparing Guid »
I am trying to get a list of all categories that contain a site with a specific ID. Below is the scaffold generated method i slightly modified. ...
(1) odpowiedzi
2017-11-13 16:11 EF Core 2.0.0 Query Filter is Caching TenantId (Updated for 2.0.1+) »
I'm building a multi-tenant application, and am running into difficulties with what I think is EF Core caching the tenant id across requests. The only...
(2) odpowiedzi
2017-11-09 03:11 Have migrations and a service that needs the database? »
How do I build a service that needs access to my database while also using migrations, given that the migrations tool "dotnet ef database update" runs...
(3) odpowiedzi
2017-10-27 17:10 How to use StructureMap Registry to Configure EF Core in Separate Project? »
I'm trying to set up a solution in Visual Studio that has all of the EF Core files in one project (Infrastructure), separate from my ASP.NET Core web ...
(1) odpowiedzi
2017-10-27 17:10 How can I use IEntityTypeConfiguration with a Base Entity? »
In EF Core 2.0, we have the ability to derive from IEntityTypeConfiguration for cleaner Fluent API mappings. Source. How can I extend this pattern to...
(1) odpowiedzi