Questions tagged [entity-framework-plus]

For questions related to zzzprojects' EntityFramework-Plus extension for Entity Framework.

74 questions
6
votes
1 answer

How to combine multiple c# Lambda Expressions (Expression>)

I have the following function which is actually a wrapper around Z.EntityFramework.Plus bulk update: public static int UpdateBulk(this IQueryable query, Expression> updateFactory) where T : IBaseEntity, new() { …
Rod
  • 63
  • 1
  • 4
6
votes
1 answer

Differense between EF Extensions UpdateFromQuery() and EF Plus Update()

The library Entity.Framework.Extensions (paid) has a method for doing entity updates: context.Customers .Where(c=>c.XXX = "") .UpdateFromQuery(c=>new Customer{ Timestamp = DateTime.UtcNow }) The library Entity.Framework.Plus (free) has a similar…
4
votes
1 answer

Database first approach with automatic CRUD logging

I have setup EF+ Audit as follows: public partial class FocusConnection : DbContext { static FocusConnection() { AuditManager.DefaultConfiguration.AutoSavePreAction = (context, audit) => // ADD "Where(x => x.AuditEntryID…
DoomerDGR8
  • 4,840
  • 6
  • 43
  • 91
3
votes
1 answer

Only update specific column using Z.EntityFramework.Plus' SingleUpdate method

In my project, I want to update a specifiy data set's column using Z.EntityFramework.Plus. I'm using the following code: await db.Features.SingleUpdateAsync(new Feature() { ID = featureInfo.ID, Unit = unit, }); The Feature class consists of…
André Reichelt
  • 1,484
  • 18
  • 52
3
votes
1 answer

Getting an 'Cannot create an instance of an interface'-error with EF Plus IncludeFilter

Having an IList, I wish to locate all matches from the context and then include a number of related tables, where outdated data are not included. Because of the size of the data, I try to use EF Plus IncludeFilter, to avoid loading all to…
San
  • 33
  • 4
3
votes
1 answer

Entity Framework Plus - Using IncludeFilter and Include

I read the documentation and I see that the limitation when using IncludeFilter is that I can't combine it with EF Include. Has anyone came into this situation where they used IncludeFilter but needed to load a navigation property that originally…
Yim Yean
  • 53
  • 6
3
votes
2 answers

what is a default cache duration of EF plus?

I am using FromCache() method whenever I need to retrieve data from cache. I haven't set any default caching policy and am using whatever EF plus use by default. What's the default cache duration? one minute? or infinite?
brian
  • 664
  • 6
  • 8
3
votes
1 answer

Entity Framework extension's batch operations vs EFE's bulk operations

I was looking into Entity Framework extensions for bulk operations and I found from the same developers EF Plus. Now EFE has bulk operations which are payed and EF PLus has Batch operations, which claim to perform bulk update and delete only, but…
2
votes
0 answers

Entity Framework Plus - Future() in a foreach loop

My question is very similar to Entity Framework Plus - FutureValue() in a foreach loop. I have this code: public class CustomerService { private readonly EntityContext Context = new EntityContext(); private IQueryable
harvzor
  • 2,832
  • 1
  • 22
  • 40
2
votes
0 answers

Entity Framework Plus dynamic filtering breaks find method

I need to dynamically filter data from the particular table depending on user's permissions. E.g. "normal" user can see only records assigned to him but admin can see all. I'm using ninject to create DB context per request and create context by…
2
votes
1 answer

Problems loading multiple levels with Entity Framework Plus

I'm having trouble with Entity Framework Plus. I can't seem to get the loading of multiple levels working. The following query works fine. I get the user back with the expected list of addresses. var user = _dataContext.Users …
Craig
  • 417
  • 3
  • 12
2
votes
1 answer

The implicit conversion of the nvarchar data type into varbinary (max) is not allowed. Use the CONVERT function to perform this query

Follow code: byte[] image1 = ConvertTo.Bytes(Request.Files[0]); byte[] image2 = null; ctx .Users .Where(x => x.Id == 1) .Update(x => new User() { ImageByte1 = image1, ImageByte2 = image2 }); Table definition: ImageByte1 varbinary(MAX)…
Matheus Miranda
  • 1,755
  • 2
  • 21
  • 36
2
votes
1 answer

How to add classes to a list?

If i have a set of Entities (Classes) like this : Employee, Department, Room ... etc How to add these classes to a list instead of a list of objects : Like this : {Employee, Department, Room} I want to get these classes because i have a method…
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
1
vote
1 answer

Working example of EF plus audit features in github

I am trying to use EF plus audit features in ASP .NET project. Is there any working example in github which i can download & run in VisualStudio ( after doing necessary changes related to DB) ? All the examples I see is with FiddleHelper which does…
1
vote
1 answer

Entity Framework Plus Batch Delete on DateTime Not working

I have run into a scenario where I need to bulk delete on a specific date time. It seems that the EF+ batch delete function doesn't correctly equate date time and perform the action. It does work fine on other field types, but just not DateTime. …
user1161137
  • 1,067
  • 1
  • 11
  • 31
1
2 3 4 5