Questions tagged as 'entity-framework'

1
answer

Open pdf / doc stored on sql server using asp.net and entityframework

I have a web application in which I am saving files of type pdf or doc in the database in a table with a parameter of type "varbinary", I know that it is not ideal to save such files in the database but I need to know how I can see that file fro...
asked by 21.06.2018 / 20:10
1
answer

Error trying to make a scaffold using entity framework code first c #

If someone could help me with the mistakes in the photo the classes are these public class RobotDog     {         public int Id {get; set; }         public string Name {get; set; }         public bool Armed {get; set; }         public virt...
asked by 30.05.2018 / 17:50
2
answers

Get daughters entities from the main table

Good I'm doing a test, and I have two tables Products and Brands. The relationship between them is 1: M that is, a brand can be present or can cover several products, while a product only belongs to one brand. This is the code that links to the...
asked by 09.05.2018 / 21:09
1
answer

How to rename the tables created by the EF by default?

Can you rename the tables created by the EF by default? When creating a project with some authentication mechanism, a number of tables corresponding to the logeo system are created automatically.     
asked by 19.06.2018 / 01:00
2
answers

Link Autoincremental ID before SaveChanges

I'll give you an example I have two tables CLOSE CierreID Descripcion Entity EntidadID CierreID Descripcion At the code level I create a Closure object Cierre a = new Cierre() a.Descripcion = "Ejemplo" db.Cierres.Add(a);...
asked by 21.03.2018 / 18:53
1
answer

I want to read rows from a database with EF Core

When I want to use the method: public async Task<IActionResult> Index() { return View(await _context.Students.ToListAsync()); } The ToListAsync method does not come out and gives me an error.     
asked by 10.01.2018 / 04:43
1
answer

Problem with keys in EF mvc5 asp .net

I have defined the keys in each of those entities with the attribute [key] as you can see in the photo, apart from that the namespace is imported "using System.ComponentModel.DataAnnotations;" and when creating controllers this happens....
asked by 23.11.2017 / 21:43
3
answers

How to convert a table to an IEnumerable to show it in a Dropdownlistfor

Good morning, I'm learning c # ASP .NET MVC, How can you convert a table to IEnumerable to use it in Dropdownlistfor ?: I have the following model: public class Saleform { public int ID { get; set; } public in...
asked by 09.10.2017 / 22:12
1
answer

Create Data Groups with Linq

I have a question with linq. here I consult a group of users, in this case 250 arrive. var usuarios = _db.usuariosmv10.Where(x => x.campana.Equals(id)).ToList(); So, in the users variable I have a list of 250 users, now that's what I nee...
asked by 29.09.2017 / 19:43
2
answers

Display data from 1 table and its relationship with another MVC

Good day mates I have this Action Result in the controller Products that looks for all the products of a certain IdEntrega and I send it to call from the Delivery view to know all the products of that delivery and it works well but now I need th...
asked by 28.08.2017 / 14:20