Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Teiko Pirate
    @teiko_pirate_twitter
    Hi People! Anyone connected to an Always On (HA) Sql Server with EF6?
    Andrii Maksymets
    @Ma3yTa
    public class MyEntity
    {
        //...
        [NotMapped]
        public MyComplexType MyComplexType { get; set; }
    
        public string MySerializedComplexType
        {
            get { return Serialize(MyComplexType); }
            set { MyComplexType = Deserialize(value); }
        }
        //...
    }
    is the way to put serialization/deserialization via fluent api in OnModelCreating
    ?
    codearoo
    @codearoo
    Hi.. having heck of a time with a caching issue with EF Core 1.01. How can I force a query on a table to re-read from the DB? I've tried db.xxxx.AsNoTracking() and it is not working.. the data gets updated outside of the same instance and I just want it to re-load.. it's like a report that should just refresh when I want it refreshed.
    Not only that, but even when I do this it still does not refresh!! FromSql("my own sql")
    mjalil
    @mjalil
    Hi Paul,
    I have an entity that has n-to-n relations and i want to bulk delete it by query. how to do that with this library. thanks
    Quan Sun
    @KingSunSha
    I am trying the pgsqlrunner branch, found some problems and fixed them. can I contribute?
    Oleg Rakitskiy
    @raol
    it should be addressed to @pwelter34, because my pgsqlrunner pull request isn't merged yet.
    Quan Sun
    @KingSunSha
    @raol I tried to contact @pwelter34 but get no response. is this project still active?
    Oleg Rakitskiy
    @raol
    dunno ¯_(ツ)_/¯
    srfabio
    @srfabio
    Hello there
    Is someone able to tell me how can I create a relationship with AspNetUserRoles with EF6 code first / migrations? I need a table that relates UserRoles and Company so that a user may have roles in more than one company. Any help would be greatly appreciated
    Steven
    @baoduy
    is this library working with EntityFramework Core?
    sj-elevate
    @shahjabeen-elevate
    This seems to be breaking with Interception, any plans to support interceptors?
    Gary Kaganas
    @Seebiscuit
    @raol newb question. Do we need to call ctx.SaveChanges for .Update()/.Delete()?
    @pwelter34?
    Oleg Rakitskiy
    @raol
    @Seebiscuit nope. All your changes go directly to the DB bypassing EF context.
    Gary Kaganas
    @Seebiscuit
    Thanks for that bit, @raol. So, does that mean that the context is not tracking the entity?
    Oleg Rakitskiy
    @raol
    Yes, you are right. Entities are not loaded into context during update/delete operations.
    Context is used as a metadata provider when query against the database is constructed from Expression<>.
    Gary Kaganas
    @Seebiscuit
    So we really should start a new context to get data from a previously tracked entity (which may be stale after an Update)
    TarrahArshad
    @TarrahArshad
    hi all
    intruder777
    @intruder777
    Hi everyone.
    Have a question rather about plain EntityFramework. When I want to access a set of entities in my context in a generic way - I should do something like:
    context.Set<TEntity>()
    but when I apply .Where(...) to the result - it gives me IEnumerable rather than IQueryable
    and when I get set of entities in a regular way: context.MyEntities1 - then when I apply .Where(...) it gives me IQueryable
    so how do I make it work as IQueryable in a generic way?
    intruder777
    @intruder777
    So when I do var x = context.Users.Where(...) -- I get IQueryable here
    But when I do var x = context.Set<T>().Where(...) in a generic way having T = User -- I get IEnumerable, but I'd like to get IQueryable. How do I get it?
    Brent Arias
    @brentarias
    @intruder777 I'm new to EF and don't know the answer. Wish I could help. :(
    I have my own question. I have several different DTO objects that I want EF to map to a single view. Unfortunately this causes EF to complain entity types cannot share table 'myView' because they are not in the same type hierarchy or do not have a valid one to one foreign key relationship.... I suspect this problem assumes that I intend read/write access to the data. Is it possible to solve this problem by telling EF that I want read-only access?
    Sammking
    @Sammking
    what is complextypes in EF6.0 and how to use them ?
    Markus Schaber
    @markusschaber
    Hmm, it seems lots of people (including me) strand here while searching for a general channel for EF or EF Core.
    Any hints where we should go instead?
    alexSushko
    @alexSushko
    Hello! Can't solve the problem with simultaneous access to data. It is necessary to make a change in the balance (row in the account table). If there are two transactions, and both of them must be performed, should I use pessimistic concurrency? But if i set the serializable isolation level then the second transaction will generate an error while saving? (I'm using DbContext.BeginTransaction) Should i execute T-SQL manually?
    mmk341341
    @mmk341341
    Do you use annotations like "Display", "RegularExpression", "Required", "ErrorMessage" when developing entityframework library(separate library project )?
    TarrahArshad
    @TarrahArshad
    hi all
    is here anybody ?
    Kouadio Brice Marcel
    @marckernel_twitter
    yes
    Frank Akogun
    @FrankDupree
    Hi guys
    Please can any of you be so kind and help solve a challenge
    the question has been asked on stackoverflow already by me
    Paul
    @PRIMETSS

    Hi!
    Anyone have any luck with the following Data Annotation & asp- helpers on an MVC page

    [Editable(false, AllowInitialValue = true)]
    public string Name { get; set; }

    I was expecting it to allow an initial value to be entered into a field, then be readonly from then on, But it just sets the field readonly always
    Whats it's use case?

    xbandi
    @xbandi

    Hi guys, please there is someone who can help me with this problem.
    I want select Advertisements from database by Machine - >Title and District -> Id

    public class Machine
        {
            public Guid Id { get; set; }
            public string Title { get; set; }
            public ICollection<AdvertisementModel> Advertisement { get; set; } = new Collection<AdvertisementModel>();
        }
    
    public class AdvertisementModel {
       public int Id { get; set; }
       . . . 
       public virtual ICollection<AdvertisementDistrict> AdvertisementDistrict { get; set; } = new Collection<AdvertisementDistrict>();
    }
    
    public class AdvertisementDistrict
        {
            public int AdvertisementId { get; set; }
            public AdvertisementModel Advertisement { get; set; }
            public int DistrictId { get; set; }
            public District District { get; set; }
        }
    
    public class District
        {
            public int Id { get; set; }
            public int Code { get; set; }
            . . .
            public virtual ICollection<AdvertisementDistrict> AdvertisementDistrict { get; set; } = new Collection<AdvertisementDistrict>();
        }

    I trying something like

            public async Task<IEnumerable<AdvertisementModel>> GetSpecificAdvertisement(string machineName, int districtId)
            {
                var advertisement = await _context.Advertisements.Where(x => x.Machine.Title == machineName).ToListAsync();
                var result = advertisement.Where(item => item.AdvertisementDistrict.Where(y => y.DistrictId == districtId));
                return result;
            }

    but item.AdvertisementDistrict.Where(y => y.DistrictId == districtId) get error :/
    Help me please. Thanks

    Islam alshiki
    @Islam-alshiki
    Hi
    My website localy works good, when i upload it using FTP on Godaddy host some error is happening when i do any action that makes any connection to databases. Could not load file or assemply 'EntityFramework, Version=6.0.0.0, Culture=nerural ...etc. BadImageFormatExaption
    scotlandYard1888
    @scotlandYard1888
    Hi, I hope this is the right place... I have a Stack Overflow question
    I'm going to be offline for a bit but I'll be back in a few hours