Questions tagged as 'entity-framework'

1
answer

The implicit conversion of the nvarchar data type into varbinary (max) is not allowed. Use the CONVERT function to perform this query

Follow the code below: byte[] image1 = ConvertTo.Bytes(Request.Files[0]); byte[] image2 = null; ctx .Users .Where(x => x.Id == 1) .Update(x => new User() { ImageByte1 = image1, ImageByte2 = image2 }); I use this here: link...
asked by 11.11.2017 / 00:18
2
answers

GET method error when consuming WebApi

I created a project in AspNet WebApi, I added an ADO (DataBase-first) to connect with the Mysql database and created the controller using the 'Controller with read / write actions and views, using Entity Framework' / strong>, when I test in a t...
asked by 03.06.2017 / 07:45
1
answer

Bank without PK, but mapped PK to Entity. Is that a problem?

I'm having problems with float fields. Well, this post will deal with another subject, but I thought I could somehow infer that problem. I stopped to think and analyze the matter. This bank belongs to the customer and is very old. If someone tel...
asked by 17.09.2017 / 02:57
0
answers

ENTITY truncating decimal value when doing SELECT

I have the following situation, When executing a query using LINQ, I have the following return 5178560,00 but if I run the same query, directly in SQL SERVER, it returns me 5179975,00 . It is not a display problem ... it already brings...
asked by 17.02.2017 / 19:59
1
answer

Organize EDMX Classes

I have a DB First project that uses an EDMX to map the database. The tables have standard columns that exist in all of them and I could organize and leave the code much more generic if I could implement interfaces in it with these properties, bu...
asked by 30.09.2016 / 21:25
1
answer

Use of search / search filters with entity framework

I'm creating a grid with data from books and I'm adding some filters, the problem is when I create the filters of a table that has a link with that of books, I can not navigate (obs.:in a view I can navigate in the view) in the object to add it...
asked by 03.02.2016 / 13:50
1
answer

ObjectDisposedException

I have the following code snippet: var nivel = 1; List<meuObjeto> meusObjetos = new List<meuObjeto>(); using(var objectContext = ((IObjectContextAdapter)db).ObjectContext) { var cmd = string.Format(@"SELECT *...
asked by 26.01.2016 / 19:35
0
answers

ASP.NET MVC - Alternative to DDD [closed]

I'm going to start building an application let's say small, initially about 5 CRUDs and only 1 Core (this is a bit more complex in terms of business), but the goal is for it to grow with the passage of time, using .NET Framework 4.5.1 and Entity...
asked by 12.01.2016 / 11:31
1
answer

Rename column with the entity framework

I'd like to know how I can solve the following problem. I have the class below: namespace CustomizandoCodeFirstMigrations.Migrations { using System; using System.Data.Entity.Migrations; public partial class AlteraTelefoneFixoRenom...
asked by 23.12.2015 / 14:38
1
answer

Linq + Lambda, subquery, distinct and not in, how to improve this query

I had the following syntax in SQL SELECT tbl_boleto.int_IDC, tbl_Admin.int_STATUS, tbl_Admin.int_CONVENIO, tbl_Admin.int_PLANO, tbl_Admin.int_RESTRICAO, tbl_Admin.str_URL FROM tbl_boleto INNER JOIN tbl_Admi...
asked by 08.03.2016 / 20:30