sql - Restrict SqlEntityConnection Type Provider to only certain tables -
i writing utility myself needs able access pair of tables in sql database. used sqlentityconnection type provider , rewarded data needed table easy use entities.
one thing noticed though startup , compiling of project increased quite lot. suspect because database has on hundred tables , it's compiling , getting data of them opposed 2 need. there way restrict entitytypeprovider referencing needed tables in schema?
type private entityconnection = sqlentityconnection<connectionstring="server=server;initial catalog=database;integrated security=sspi;multipleactiveresultsets=true", pluralize = true> let private context = entityconnection.getdatacontext()
i have not tried myself, think add new "ado.net entity data model" (edmx) file project, let generate existing database, , delete model every table don't want accessible code.
the edmx designer generate *.csdl file can reference localschemafile
parameter of sqlentityconnection. you'd use parameter instead of connectionstring
.
the end result entity provider not automatically pick changes database, compilation times go down, , tables care visible code.
Comments
Post a Comment