How to get fluent api mapped entity table name EF -


i'm having problems getting mapped table name when using fluent api. when use data annotations it's easy because can use tableattribute in order table name specific entity, when use fluent api can't find way that.

i need because i'm implementing audit trail overriding savechanges on dbcontext.

thanks

i figure out.

in order information entity when using fluent api did this:

// actual entity set // dataspace.sspace = storage part of model has info shape of our tables var entityset = workspace.getitems<system.data.entity.core.metadata.edm.entitycontainer>(system.data.entity.core.metadata.edm.dataspace.sspace)                 .selectmany(e => e.entitysets).tolist().where(a => a.name == entitytypename).firstordefault(); 

and finally:

// table name string tablename = entityset.table; 

hope can others!


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -