EF bulk insert and update without hitting db repeatedly
suppose i have many employee data strored in list<emp>. now few data is new in list and few updated. so tell me best way to bulk insert and update without hitting db repeatedly with...
View ArticleEntity Framework Grouping By Year And Month
i hardly use EF so not string in it.code taken from https://www.mikesdotnetting.com/article/257/entity-framework-recipe-grouping-by-year-and-monthpublic ActionResult Index() { var context = new...
View ArticleWeb API
I want to use a Web API to populate a select element using the entity framework as my datasource and mvc as my framework. Thanks ! Also I was wondering why would it be a best practice to use a Web API?...
View ArticleWeb Api and repository pattern
If I am using a web api to fetch data should I be using a repository pattern for my web api? Thanks !
View ArticleHierarchical Data Management with EF
just read article from this link https://www.mikesdotnetting.com/article/255/entity-framework-recipe-hierarchical-data-managementwhy menuitemid column is required in table. if i develop the same table...
View Articleexcel without formatting in cells
Hello. I am using somthing like this to import excel to a dataset ("provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + TextBox1.Text + "';Extended Properties=""Excel 8.0;IMEX=1""") This has an issue...
View ArticleReceiving NHibernate with MySQL Syntax error during table creation in C#
hi,I am new to NHibernate, while doing simple crude operation with NHibernate and MySQL database, I am getting error as:You have an error in your SQL syntax; check the manual that corresponds to your...
View ArticleReceiving GenericADOException while using NHibernate 4.1 with MySQL Database
Hi,I am new to NHibernate, while using NHibernate with MySQL database I am getting error at transaction.Commit().Error:NHibernate.Exceptions.GenericADOException was unhandled HResult=-2146232832...
View ArticleReuse of models
What if I wanted to reuse a model that populates all select elements in my mvc web application. I don't know if anyone has heard of module Model View Control where all models and views are put in two...
View ArticleMaking effective db calls (reducing number of trips to db)?
I have some code that sends many individual calls to the db in order to populate data in one viewmodel.I have one Company entity. It has Meetings and Plans as collections. I don't want to include all...
View ArticleCode to call stored procedure
Greetings all, please I need a code for calling stored procedure in MVC. Thanks in anticipation and regards .
View ArticleModel Updateability
Kinda new to EFMy boss is expressing concerns about how updating our database' schema might effect the EF models we have.Example: We create a view and bring that into the EF model. Somewhere down the...
View ArticleLinq to SQL and Stored Procedure
I am using Linq to SQL. Below is the code I am using. As you can see I am using a stored procedure and passing it an integer but yet q, the inferred type variable contains nothing after this code is...
View ArticleHow return number of rows affected by session.save in NHibernate C#
Hi,Can anyone tell me how to return number of rows affected by insert or update query in NHibernate. I am using Repository pattern. DataRepository Class:using System; using System.Collections.Generic;...
View ArticleFunction that returns the results of a linq query.
I was just wondering what is best practice for writing a function that returns the results of a linq query. What should be the type of the function? Thanks for any advice anyone can provide.
View ArticleDisregard - was Custom Class to EF mapping
Went with a solution that makes OP mootsorry :-(MODS: can you guys delete this thread?
View ArticleRecursive Efficiency!
Hi all,I'm trying to speed up a hierarchical tree builder with LINQ, this is what I have but it takes ages for trees that are thousands deep! Any tip on speeding this up at all?void...
View ArticleHow to insert a Parent along with it's children in EF Core
In my ASP.NET Core 1.1.1 MVC web app, the Intellisense of the code editor of VS2017 does not recognize .child at line p.child.Add(c1);. What is the correct way of adding a Parent along with it's...
View ArticleDifference between EF and dapper
i am looking for few good points which clearly tell me difference between EF and dapper. so give me some points with sample code which show the difference in terms of code between EF and dapper.
View ArticleStackOverflowException when including a navigation property
I have a collection of ProjectMissingPeople as a navigation property on Project. When I try to include them when passing a list of Project to a view, I get a stack overflow exception. Do you know how...
View Article