Search Results

Search found 9916 results on 397 pages for 'entity component'.

Page 32/397 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Is there an ORM with APIs to be used programatically?

    - by Kabeer
    Hello. Neither did not get any response for my previous question, nor enough views :) So here I am now framing my query afresh. Is there any ORM that offers APIs to be used programatically? In my situation, a user will be helped through a wizard to define some entities. Thereafter those entites will be created in a database in form of tables (there will of course be some improvization). I need an ORM that offers APIs for modeling and creating entities during application runtime and not just during design time. Mine is a .Net application, therefore I was looking at Entity Framework. However, to me it looked tied to Visual Studio (I may be wrong also as I am new to it). Any recommendations? Or alternative point of view?

    Read the article

  • A generic Find method to search by Guid type for class implementing IDbSet interface

    - by imak
    I am implementing a FakeDataSet class by implementing IDbSet interface. As part of implementing this interface, I have to implement Find method. All my entity classes has an Guid type Id column. I am trying to implement Find method for this FakeDbSet class but having hard time to write it in a generic way. Below is my attempts for writing this method but since it does not know about Id been Guid type, I am getting compilation error on m.Id call. Any ideas on how this could be accomplished? public class FakeDataSet<T> : IDbSet<T> where T: class, new() { // Other methods for implementing IDbSet interface public T Find(params object[] keyValues) { var keyValue = (Guid)keyValues.FirstOrDefault(); return this.SingleOrDefault(m => m.Id == keyValue); // How can I write this } }

    Read the article

  • Entity Framework 4.3.1 Code based Migrations and Connector/Net 6.6

    - by GABMARTINEZ
     Code-based migrations is a new feature as part of the Connector/Net support for Entity Framework 4.3.1. In this tutorial we'll see how we can use it so we can keep track of the changes done to our database creating a new application using the code first approach. If you don't have a clear idea about how code first works we highly recommend you to check this subject before going further with this tutorial. Creating our Model and Database with Code First  From VS 2010  1. Create a new console application 2.  Add the latest Entity Framework official package using Package Manager Console (Tools Menu, then Library Package Manager -> Package Manager Console). In the Package Manager Console we have to type  Install-Package EntityFramework This will add the latest version of this library.  We will also need to make some changes to your config file. A <configSections> was added which contains the version you have from EntityFramework.  An <entityFramework> section was also added where you can set up some initialization. This section is optional and by default is generated to use SQL Express. Since we don't need it for now (we'll see more about it below) let's leave this section empty as shown below. 3. Create a new Model with a simple entity. 4. Enable Migrations to generate the our Configuration class. In the Package Manager Console we have to type  Enable-Migrations; This will make some changes in our application. It will create a new folder called Migrations where all the migrations representing the changes we do to our model.  It will also create a Configuration class that we'll be using to initialize our SQL Generator and some other values like if we want to enable Automatic Migrations.  You can see that it already has the name of our DbContext. You can also create you Configuration class manually. 5. Specify our Model Provider. We need to specify in our Class Configuration that we'll be using MySQLClient since this is not part of the generated code. Also please make sure you have added the MySql.Data and the MySql.Data.Entity references to your project. using MySql.Data.Entity;   // Add the MySQL.Data.Entity namespace public Configuration() { this.AutomaticMigrationsEnabled = false; SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());    // This will add our MySQLClient as SQL Generator } 6. Add our Data Provider and set up our connection string <connectionStrings> <add name="PersonalContext" connectionString="server=localhost;User Id=root;database=Personal;" providerName="MySql.Data.MySqlClient" /> </connectionStrings> <system.data> <DbProviderFactories> <remove invariant="MySql.Data.MySqlClient" /> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories> </system.data> * The version recommended to use of Connector/Net is 6.6.2 or earlier. At this point we can create our database and then start working with Migrations. So let's do some data access so our database get's created. You can run your application and you'll get your database Personal as specified in our config file. Add our first migration Migrations are a great resource as we can have a record for all the changes done and will generate the MySQL statements required to apply these changes to the database. Let's add a new property to our Person class public string Email { get; set; } If you try to run your application it will throw an exception saying  The model backing the 'PersonelContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269). So as suggested let's add our first migration for this change. In the Package Manager Console let's type Add-Migration AddEmailColumn Now we have the corresponding class which generate the necessary operations to update our database. namespace MigrationsFromScratch.Migrations { using System.Data.Entity.Migrations; public partial class AddEmailColumn : DbMigration { public override void Up(){ AddColumn("People", "Email", c => c.String(unicode: false)); } public override void Down() { DropColumn("People", "Email"); } } } In the Package Manager Console let's type Update-Database Now you can check your database to see all changes were succesfully applied. Now let's add a second change and generate our second migration public class Person   {       [Key]       public int PersonId { get; set;}       public string Name { get; set; }       public string Address {get; set;}       public string Email { get; set; }       public List<Skill> Skills { get; set; }   }   public class Skill   {     [Key]     public int SkillId { get; set; }     public string Description { get; set; }   }   public class PersonelContext : DbContext   {     public DbSet<Person> Persons { get; set; }     public DbSet<Skill> Skills { get; set; }   } If you would like to customize any part of this code you can do that at this step. You can see there is the up method which can update your database and the down that can revert the changes done. If you customize any code you should make sure to customize in both methods. Now let's apply this change. Update-database -verbose I added the verbose flag so you can see all the SQL generated statements to be run. Downgrading changes So far we have always upgraded to the latest migration, but there may be times when you want downgrade to a specific migration. Let's say we want to return to the status we have before our last migration. We can use the -TargetMigration option to specify the migration we'd like to return. Also you can use the -verbose flag. If you like to go  back to the Initial state you can do: Update-Database -TargetMigration:$InitialDatabase  or equivalent: Update-Database -TargetMigration:0  Migrations doesn't allow by default a migration that would ocurr in a data loss. One case when you can got this message is for example in a DropColumn operation. You can override this configuration by setting AutomaticMigrationDataLossAllowed to true in the configuration class. Also you can set your Database Initializer in case you want that these Migrations can be applied automatically and you don't have to go all the way through creating a migration and updating later the changes. Let's see how. Database Initialization by Code We can specify an initialization strategy by using Database.SetInitializer (http://msdn.microsoft.com/en-us/library/gg679461(v=vs.103)). One of the strategies that I found very useful when you are at a development stage (I mean not for production) is the MigrateDatabaseToLatestVersion. This strategy will make all the necessary migrations each time there is a change in our model that needs a database replication, this also implies that we have to enable AutomaticMigrationsEnabled flag in our Configuration class. public Configuration()         {             AutomaticMigrationsEnabled = true;             AutomaticMigrationDataLossAllowed = true;             SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());    // This will add our MySQLClient as SQL Generator          } In the new EntityFramework section of your Config file we can set this at a context level basis.  The syntax is as follows: <contexts> <context type="Custom DbContext name, Assembly name"> <databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[ Custom DbContext name, Assembly name],  [Configuration class name, Assembly name]],  EntityFramework" /> </context> </contexts> In our example this would be: The syntax is kind of odd but very convenient. This way all changes will always be applied when we do any data access in our application. There are a lot of new things to explore in EF 4.3.1 and Migrations so we'll continue writing some more posts about it. Please let us know if you have any questions or comments, also please check our forums here where we keep answering questions in general for the community.  Hope you found this information useful. Happy MySQL/.Net Coding! 

    Read the article

  • The JavaServer Faces 2.2 viewAction Component

    - by Janice J. Heiss
    Life just got easier for users of JavaServer Faces. In a new article, now up on otn/java, titled “New JavaServer Faces 2.2 Feature: The viewAction Component,” Tom McGinn, Oracle’s Principal Curriculum Developer for Oracle Server Technologies, explores the advantages offered by the JavaServer Faces 2.2 view action feature, which, according to McGinn, “simplifies the process for performing conditional checks on initial and postback requests, enables control over which phase of the lifecycle an action is performed in, and enables both implicit and declarative navigation.”As McGinn observes: “A view action operates like a button command (UICommand) component. By default, it is executed during the Invoke Application phase in response to an initial request. However, as you'll see, view actions can be invoked during any phase of the lifecycle and, optionally, during postback, making view actions well suited to performing preview checks.”McGinn explains that the JavaServer Faces 2.2 view action feature offers several advantages over the previous method of performing evaluations before a page is rendered:   * View actions can be triggered early on, before a full component tree is built, resulting in a lighter weight call.   * View action timing can be controlled.   * View actions can be used in the same context as the GET request.   * View actions support both implicit and explicit navigation.   * View actions support both non-faces (initial) and faces (postback) requests.Read the complete article here.

    Read the article

  • Problem with Entity Framework : "The underlying provider failed on Open"

    - by pokrate
    Hi, When I try to insert a record, I get this error : The underlying provider failed on Open. This error occurs only with IIS and not with VWD 2008's webserver. In the EventViewer I get this Application Error : Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed. [CLIENT: ] <add name="ASPNETDBEntities" connectionString="metadata=res://*/Models.FriendList.csdl|res://*/Models.FriendList.ssdl|res://*/Models.FriendList.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> I am using aspnetdb.mdf file, and not any external database. I have searched enough for this, but no use. Everything works fine with VWD webserver

    Read the article

  • SqlBulkCopy and Entity Framework

    - by KP
    My current project consists of 3 standard layers: data, business, and presentation. I would like to use data entities for all my data access needs. Part of the functionality of the app will that it will need to copy all data within a flat file into a database. The file is not so big so I can use SqlBulkCopy. I have found several articles regarding the usage of SqlBulkCopy class in .NET. However, all the articles are using DataTables to move data back and forth. Is there a way to use data entities along with SqlBulkCopy or will I have to use DataTables?

    Read the article

  • How to use multiple DisplayName attribute using Entity Framework and ASP.Net Mvc 2

    - by Picflight
    Depending on where I use my Class, I want to be able to show a different DisplayName. I have the following class: [MetadataType(typeof(PortalMetaData))] [System.Web.Mvc.Bind(Exclude = "PortalId")] public partial class Portal { public Portal() { this.Created = DateTime.Now; } } public class PortalMetaData { [Required(ErrorMessage = "Portal name is required")] [StringLength(50, ErrorMessage = "Portal name must be under 50 characters")] public object PortalName { get; set; } [Required(ErrorMessage = "Description is required")] public object Description { get; set; } } I have a corresponding Table in the database Portal I use the Portal table with a PortalController for the Site Admin to update the records in the Portal Table. I want another user with a different Role (AsstAdmin) to be able to update this table as well. To facilitate that I am thinking of creating a separate partial class that somehow links back to the Portal Model. This would allow me to display limited Fields for update by the AsstAdmin and I can display a different name for the Field as well. How can I accomplish this task? If I add the following class which inherits from Portal than I get an exception: Unable to cast object of type 'Project1.Mvc.Models.Portal' to type 'Prpject1.Mvc.Models.Site'. [MetadataType(typeof(SiteMetaData))] public class Site : Portal { public Site() { } } public class SiteMetaData { [Required(DisplayName = "Site Description")] public object Description { get; set; } }

    Read the article

  • IQueryable<> from stored procedure (entity framework)

    - by mmcteam
    I want to get IQueryable<> result when executing stored procedure. Here is peace of code that works fine: IQueryable<SomeEntitiy> someEntities; var globbalyFilteredSomeEntities = from se in m_Entities.SomeEntitiy where se.GlobalFilter == 1234 select se; I can use this to apply global filter, and later use result in such way result = globbalyFilteredSomeEntities .OrderByDescending(se => se.CreationDate) .Skip(500) .Take(10); What I want to do - use some stored procedures in global filter. I tried: Add stored procedure to m_Entities, but it returns IEnumerable<> and executes sp immediately: var globbalyFilteredSomeEntities = from se in m_Entities.SomeEntitiyStoredProcedure(1234); Materialize query using EFExtensions library, but it is IEnumerable<>. If I use AsQueryable() and OrderBy(), Skip(), Take() and after that ToList() to execute that query - I get exception that DataReader is open and I need to close it first(can't paste error - it is in russian). var globbalyFilteredSomeEntities = m_Entities.CreateStoreCommand("exec SomeEntitiyStoredProcedure(1234)") .Materialize<SomeEntitiy>(); //.AsQueryable() //.OrderByDescending(se => se.CreationDate) //.Skip(500) //.Take(10) //.ToList(); Also just skipping .AsQueryable() is not helpful - same exception. When I put ToList() query executes, but it is too expensive to execute query without Skip(), Take().

    Read the article

  • Entity Framework - Condition on one to many join (Lambda)

    - by nirpi
    Hi, I have 2 entities: Customer & Account, where a customer can have multiple accounts. On the account, I have a "PlatformTypeId" field, which I need to condition on (multiple values), among other criterions. I'm using Lambda expressions, to build the query. Here's a snippet: var customerQuery = (from c in context.CustomerSet.Include("Accounts") select c); if (criterions.UserTypes != null && criterions.UserTypes.Count() > 0) { List<short> searchCriterionsUserTypes = criterions.UserTypes.Select(i => (short)i).ToList(); customerQuery = customerQuery.Where(CommonDataObjects.LinqTools.BuildContainsExpression<Customer, short>(c => c.UserTypeId, searchCriterionsUserTypes)); } // Other criterions, including the problematic platforms condition (below) var customers = customerQuery.ToList(); I can't figure out how to build the accounts' platforms condition: if (criterions.Platforms != null && criterions.Platforms.Count() > 0) { List<short> searchCriterionsPlatforms = criterions.Platforms.Select(i => (short)i).ToList(); customerQuery = customerQuery.Where(c => c.Accounts.Where(LinqTools.BuildContainsExpression<Account, short>(a => a.PlatformTypeId, searchCriterionsPlatforms))); } (The BuildContainsExpression is a method we use to build the expression for the multi-select) I'm getting a compilation error: The type arguments for method 'System.Linq.Enumerable.Where(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. Any idea how to fix this? Thanks, Nir.

    Read the article

  • Entity Framework: Delete Object and its related entities

    - by Waheed
    Hi, Does anyone know how to delete an object and all of it's related entities. For example i have tables, Products, Category, ProductCategory and productDetails, the productCategory is joining table of both Product and Category. I have red from http://msdn.microsoft.com/en-us/library/bb738580.aspx that Deleting the parent object also deletes all the child objects in the constrained relationship. This result is the same as enabling the CascadeDelete property on the association for the relationship. I am using this code Product productObj = this.ObjectContext.Product.Where(p => p.ProductID.Equals(productID)).First(); if (!productObj.ProductCategory.IsLoaded) productObj.ProductCategory.Load(); if (!productObj.ProductDetails.IsLoaded) productObj.ProductDetails.Load(); //my own methods. base.Delete(productObj); base.SaveAllObjectChanges(); But i am getting error on ObjectContext.SaveChanges(); i.e A relationship is being added or deleted from an AssociationSet 'FK_ProductCategory_Product'. With cardinality constraints, a corresponding 'ProductCategory' must also be added or deleted. Thanks in advance....

    Read the article

  • Random sort list with LINQ and Entity Framework in vb.net

    - by Sander Versluys
    I've seen many examples in LINQ but i'm not able to reproduce the same result in vb.net. I have following code: Dim context As New MyModel.Entities() Dim rnd As New System.Random() Dim gardens As List(Of Tuin) = (From t In context.Gardens Where _ t.Approved = True And _ Not t.Famous = True _ Order By rnd.Next() _ Select t).ToList() But i receive an error when binding this list to a control. LINQ to Entities does not recognize the method 'Int32 Next()' method, and this method cannot be translated into a store expression. Any suggestion on how to get this to work?

    Read the article

  • Entity Framework: How to bind related products

    - by Waheed
    I am using the following Linq query from p in Product.Include("ProductDetails.Colors") where p.ProductID.Equals(18) select p; And then using the result of this query to bind the GridView. The productDetails are bind to the grid fine, but the Colors are not bind. To bind colors i am using <%# Eval("Colors.CategoryName") %. Error is " Field or property with the name 'Colors.CategoryName' was not found on the selected data source." But in a loop i am getting this fine. foreach (ProductDetails proDet in pd.ProductDetails) { string bar = proDet.BarCode; string color = proDet.Colors.CategoryName; }

    Read the article

  • Entity Framework - ContextBuilder namespace

    - by Matt
    I apologize if this seems like an excessively dumb question. I am trying to use the ContextBuilderClass to generate my Context. I am unable to find the proper assembly and namespace to use it though. Just for reference I am on a full install of VS 2010 Pro.

    Read the article

  • How to clone a Model using Entity Framework and ASP.Net Mvc 2

    - by Picflight
    I have the following class: [MetadataType(typeof(PortalMetaData))] [System.Web.Mvc.Bind(Exclude = "PortalId")] public partial class Portal { public Portal() { this.Created = DateTime.Now; } } public class PortalMetaData { [Required(ErrorMessage = "Portal name is required")] [StringLength(50, ErrorMessage = "Portal name must be under 50 characters")] public object PortalName { get; set; } [Required(ErrorMessage = "Description is required")] public object Description { get; set; } } I have a corresponding Table in the database Portal I use the Portal table with a PortalController for the Site Admin to update the records in the Portal Table. I want another user with a different Role (AsstAdmin) to be able to update this table as well. To facilitate that I am thinking of creating a separate partial class that somehow links back to the Portal Model. This would allow me to display limited Fields for update by the AsstAdmin and I can display a different name for the Field as well. How can I accomplish this task? If I add the following class which inherits from Portal than I get an exception: Unable to cast object of type 'Project1.Mvc.Models.Portal' to type 'Prpject1.Mvc.Models.Site'. [MetadataType(typeof(SiteMetaData))] public class Site : Portal { public Site() { } } public class SiteMetaData { [Required(DisplayName = "Site Description")] public object Description { get; set; } }

    Read the article

  • Entity Data Model & DataGridView - Creating new objects

    - by AcousticBoom
    I'm pretty new to the EDM, so bear with me. I have a windows form that has a DataGridView on it that's bound from the EDM I created. I figured out how to update my changes fine, but it's when the user creates a new row that I'm having a problem. I tried numerous ways and many google searches, but came up with nothing so far. Here's how the data is loaded: Dim boilerID As Integer = DirectCast(ddlBoiler.SelectedValue, Integer) Dim countryID As Integer = DirectCast(ddlCountry.SelectedValue, Integer) Dim ratings = From r In _Context.Rating _ Where r.Boiler.Boiler_ID = boilerID _ And r.Country.Country_ID = countryID _ Order By r.Sequence _ Select r RatingBindingSource.DataSource = ratings.ToList() Also, all I'm doing to save the information right now is the following: Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click _Context.SaveChanges() End Sub I want the user to be able to use the grid's "new row" feature to add new items to the database instead of having to click a button and open a new dialog. How would this be accomplished? I can include some of the methods i tried for adding new items if anyone needs to see. Thanks!

    Read the article

  • Cannot rollback ransaction with Entity Framework

    - by Luca
    I have to do queries on uncommitted changes and I tried to use transactions, but I found that it do not work if there are exceptions. I made a simple example to reproduce the problem. I have a database with only one table called "Tabella" and the table has two fields: "ID" is a autogenerated integer, and "Valore" is an integer with a Unique constraint. Then I try to run this code: using (TransactionScope scope = new TransactionScope()) { Db1Container db1 = new Db1Container(); try { db1.AddToTabella(new Tabella() { Valore = 1 }); db1.SaveChanges(); } catch { } try { db1.AddToTabella(new Tabella() { Valore = 1 }); db1.SaveChanges(); //Unique constraint is violated here and an exception is thrown } catch { } try { db1.AddToTabella(new Tabella() { Valore = 2 }); db1.SaveChanges(); } catch { } //scope.Complete(); //NEVER called } //here everything should be rolled back Now if I look into the database it should contain no records because the transaction should rollback, instead I find two records!!!! One with Valore=1 and one with Valore=2. I am missing something? It looks like the second call to SaveChanges method rollback its own changes and "deletes" the transaction, then the third call to SaveChanges commits the changes of the first and the third insert (at this point it is like the transaction not exists). I also tried to use SaveChanges(false) method (even without calling AcceptAllChanges method), but with no success: I have the same behaviour. I do not want the transaction to be rolled back automatically by SaveChanges, because I want to correct the errors (for example by user interaction in the catch statement) and make a retry. Can someone help me with this? It seems like a "bug", and it is giving me a really big headache...

    Read the article

  • Calling Entity Framework function import from code

    - by Mikey Cee
    So I have a stored procedure called Spr_EventLogCreate defined in my database. I have created a function import in my data model called LogEvent with no return type, and I can see this function in the Model Browser tree at MyModel.edmx MyModel EntityContainer Function Imports LogEvent. I thought I should then be able to call the function in my code as follows: var context = new MyModelEntities(); context.LogEvent(...); But the LogEvent() method is not present. I must be being really stupid here, but how do I call my imported function? Using VS 2008 and EF 3.5.

    Read the article

  • NULL values in object properties in Entity Framework

    - by Tony
    Tables: Article, Author, Comment (1 article and 1 author can have * comments) In the database is 1 article, 1 author and 1 comment. The problem is, that code myBD my_bd = new myBD(); var articles = by_bd.Article; works OK, I can see that an Author and an Article has 1 comment. But that code var comm = (from u in my_bd.Comment where ...... select u); returns the comment but it has NULL values in property Article and Author. Why ?

    Read the article

  • Entity Framework without Transaction?

    - by Sue
    Is there a way to use EF without transaction? I have very simple single insert and don't want to roll-back when something goes wrong as there may be a trigger logging then raising error from the DB side which I have no control over. I just want to insert then catch any exceptions but don't want to roll-back.

    Read the article

  • Entity Framework - Using a list as a paramater in a compiled query

    - by vdh_ant
    Hi guys Just wondering if anyone knows whether I should be able to pass in list into a compiled query and have the query perform a contains operation? The reason why I ask is that I have a scenario where I need to do this, yet at run time I am getting the following error... The specified parameter 'categories' of type 'System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' is not valid. Only scalar parameters (such as Int32, Decimal, and Guid) are supported. I can understand why this might be the case but I was wondering if anyone knows a way around it. Cheers Anthony

    Read the article

  • Accessing the relationship of a relationship with Entity Framework

    - by J. Pablo Fernández
    I the School class I have this code: from student in this.Students where student.Teacher.Id == id select student The Student class there are two relationships: Teacher and School. In the School class I'm trying to find out all the students whose Teacher has a given id. The problem is that I get System.NullReferenceException: Object reference not set to an instance of an object. in the statement student.Teacher.Id I thought of doing this.Students.Include("Teacher"), but this.Students doesn't have such a method. Any ideas how can I perform that query?

    Read the article

  • entity framework, loadproperty not working - The selector expression for LoadProperty must be a Memb

    - by SLC
    The selector expression for LoadProperty must be a MemberAccess for the property. I'm converting some C# to VB, this is the C# line: entities.LoadProperty((MyType)MyTargetObject, c => c.MyProperty); I convert it to VB like so: entities.LoadProperty(DirectCast(MyTargetObject, MyType), Function(c) c.MyProperty) However I get the error above. I don't understand what the code is doing, or anything at all, I am simply converting it line by line into Visual Basic. When I run the project, the error I get is the one above. All I can see is that Entities is a class that inherits ObjectContext, which might mean something. Any help would be soooo good because I am stressing out big time. Thanks.

    Read the article

  • Disable lazy loading by default in Entity Framework 4

    - by Mikey Cee
    It seems that lazy loading is enabled by default in EF4. At least, in my project, I can see that the value of dataContext.ContextOptions.LazyLoadingEnabled is true by default. I don't want lazy loading and I don't want to have to write: dataContext.ContextOptions.LazyLoadingEnabled = false; each time I get a new context. So is there a way to turn it off by default, say, across the whole project?

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >