Questions tagged as 'entity-framework-6'

1
answer

List, virtual and Entity Framework

In all examples I have found about entity framework, they always use ICollection for object collections. public partial class Standard { public Standard() { this.Students = new HashSet<Student>(); this.Teac...
asked by 26.05.2016 / 17:16
1
answer

How to set a field of type string as nullable in Code First?

I have the field descrPapel of type string and would like this field to be created as nullable , that is, accept null when doing some insert / update entity type. using System; using System.Collections.Generic; usi...
asked by 25.11.2016 / 15:49
1
answer

Problem with Include in the Entity Framework

I have the classes: public class Estado { public int Id { get; set; } public string Nome { get; set; } public string Uf{ get; set; } public ICollection<Cidade> Cidade { get; set; } } public class Cidade { public int...
asked by 14.10.2014 / 05:05
2
answers

How to create user with password encryption?

How do I do in my ASP.Net MVC 5 and EF 6 application to save encrypted passwords in MD5 format when creating users?     
asked by 15.05.2014 / 21:43
1
answer

Rollback SqlServer on writing two different tables

Premise: I'm using EntityFramework6 for data persistence in SQLServer. At some point I need to write data in two different tables, but the second table has dependency on the first example. try{ MetodoPersisteNaTabelaA(); MetodoP...
asked by 08.02.2018 / 12:36
1
answer

How can I convert datetime to date string?

Follow the code: var fullEntries = dbContext.tbl_EntryPoint .Join( dbContext.tbl_Title, combinedEntry => combinedEntry.entry.TID, title => title.TID, (combinedEntry, title) => new {...
asked by 29.03.2017 / 02:05
1
answer

The client entity type is not part of the template for the current context

I'm trying to reproduce this example of EntityFramework with standard repository, as follows the link: link But it is giving the error described in the topic title. I'll post the codes. The first is the class BancoContext.cs: using...
asked by 24.07.2016 / 04:23
1
answer

Entity Framework 6 relationship

I have a class where I need to have 2 different relationships with the same table. public class Usuario { public int Naturalidade {set;get;} public int CidadeEndereco {set;get; } public class Cidade { public int Id {se...
asked by 17.06.2016 / 21:10
3
answers

Problem saving accent with Entity Framework and PostgreSQL

I need to migrate a system with SQLSERVER database to a PostGreSQL 9.3. I have never worked with PostGre before so I'm using Entity Framework 6 with model-first to make the process easier. The migration application is being developed in WPF. My...
asked by 28.06.2016 / 22:23
2
answers

Attribute Type for PostgreSQL oid column with EF6

What kind of attribute should I use to represent a column type oid of PostgreSQL with Entity Framework 6 Code-First? Remembering that PostgreSQL's oid type is for storing files.     
asked by 24.05.2016 / 16:27