entity-framework-6

EF OData MySql Unknown column 'Project3.x' in 'where clause'

南楼画角 提交于 2019-12-23 02:37:06
问题 I'm using OData V4, EF6 and MySql 5.6/5.7 With below models and tables. I get the result of the Application resource fine with this call odata/Applications but I get this error when I expand on roles, as follows odata/Applications?$expand=roles. Error: An error occurred while executing the command definition. See the inner exception for details. Unknown column 'Project3.ApplicationId' in 'where clause' I know it's something with mapping, but I can't see what. public class Role { public int Id

Managed Oracle Client with Oracle Advanced Security Options

南笙酒味 提交于 2019-12-23 02:17:18
问题 On October 14th, Oracle release the latest version of their Oracle Managed Client which was described to support Network Data Encryption. http://www.oracle.com/technetwork/topics/dotnet/tech-info/odac12cr4ds-2704217.pdf https://www.nuget.org/packages/Oracle.ManagedDataAccess/ Although for some reason after trying multiple configuration, we still weren't able to get it to work. We keep getting the infamous ORA-12570: Network Session: Unexpected packet read error exception wrapped in The

Has EF6+ / 7 added any ways that I can add update child tables?

故事扮演 提交于 2019-12-23 01:59:09
问题 I have two tables: public AdminTest() { this.AdminTestQuestions = new List<AdminTestQuestion>(); } public int AdminTestId { get; set; } public string Title { get; set; } public virtual ICollection<AdminTestQuestion> AdminTestQuestions { get; set; } } public partial class AdminTestQuestion { public int AdminTestQuestionId { get; set; } public int AdminTestId { get; set; } public System.Guid QuestionUId { get; set; } public virtual AdminTest AdminTest { get; set; } } I am using the following

Build string method using complex type Entity Framework ASP.NET C#

大兔子大兔子 提交于 2019-12-23 01:55:50
问题 I had to use Entity Framework to equip an advanced search to my website application. The model is generated from the database and has own entities but has some complex stored procedure that returning mixed columns. To clarify, I have a customer entity with own columns but I want to use complex customer_Fetch_List_Result that is imported from the database to implement my advanced search. using (DbModel db = new DbModel()) { var query = db.customer_Fetch_List(ViewState["Gym"].ToString(), 0)

Build string method using complex type Entity Framework ASP.NET C#

吃可爱长大的小学妹 提交于 2019-12-23 01:55:08
问题 I had to use Entity Framework to equip an advanced search to my website application. The model is generated from the database and has own entities but has some complex stored procedure that returning mixed columns. To clarify, I have a customer entity with own columns but I want to use complex customer_Fetch_List_Result that is imported from the database to implement my advanced search. using (DbModel db = new DbModel()) { var query = db.customer_Fetch_List(ViewState["Gym"].ToString(), 0)

Changing EF6 source code for conversion of short to bool

北战南征 提交于 2019-12-23 01:25:13
问题 What is the feasibility of modifying the mapping code to convert a short of value zero or non-zero to false or true, if the boolean destination property is marked with an attribute in the POCO model? I mean, this is supposed to be one of the advantages of EF being open sourced, and would be for in house use only. Any tips on where in the code I would look would be appreciated, but this question is really more general and I'd like to hear anything anyone has to say on this. 回答1: With regard to

Incorrect usage of spatial/fulltext/hash index and explicit index order EF

风流意气都作罢 提交于 2019-12-22 18:12:15
问题 I am getting Incorrect usage of spatial/fulltext/hash index and explicit index order this error while trying to login. I am not using Entity Framework migration. [DbConfigurationType(typeof(MySqlEFConfiguration))] public class ApplicationDbContext : IdentityDbContext<ApplicationUser> { public ApplicationDbContext() : base("DefaultConnection") { } static ApplicationDbContext() { // Set the database intializer which is run once during application start // This seeds the database with admin user

Entity Framework multiple aggregation performance

无人久伴 提交于 2019-12-22 13:53:38
问题 I have a question about entity framework query building. Schema I have a table structure like this: CREATE TABLE [dbo].[DataLogger]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [ProjectID] [bigint] NULL, CONSTRAINT [PrimaryKey1] PRIMARY KEY CLUSTERED ( [ID] ASC ) ) CREATE TABLE [dbo].[DCDistributionBox]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [DataLoggerID] [bigint] NOT NULL, CONSTRAINT [PrimaryKey2] PRIMARY KEY CLUSTERED ( [ID] ASC ) ) ALTER TABLE [dbo].[DCDistributionBox] ADD CONSTRAINT [FK

Improving performance of big EF multi-level Include

我怕爱的太早我们不能终老 提交于 2019-12-22 13:52:45
问题 I'm an EF noob (as in I just started today, I've only used other ORMs), and I'm experiencing a baptism of fire. I've been asked to improve the performance of this query created by another dev: var questionnaires = await _myContext.Questionnaires .Include("Sections") .Include(q => q.QuestionnaireCommonFields) .Include("Sections.Questions") .Include("Sections.Questions.Answers") .Include("Sections.Questions.Answers.AnswerMetadatas") .Include("Sections.Questions.Answers.SubQuestions") .Include(

Do I have to reference the Entity Framework 6 dll in all Projects? (not only my DAL)

送分小仙女□ 提交于 2019-12-22 10:56:51
问题 Question - Do applications really have to install EF6 to consume another class library that used EF6 as it's underlying data retrieval mechanism (or am I mistaken)? - How can I work around this and still use EF? Scenario We are rewriting an old DAL with a new version that uses EF6 to get it's data. Consumer apps don't call on the EF context. They instead call intermediate functions (in a Business Logic folder in the DAL project), that in turn calls on EF. When I have a consuming app reference