【发布时间】:2013-01-23 16:53:50
【问题描述】:
EF 为我生成了一些部分类,每个类都有一个构造函数,但它说不要碰它们(下面的示例),现在如果我创建自己的次要部分类并且我想要一个构造函数来自动设置一些字段我该怎么做,否则会发生冲突?
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Breakdown.Models
{
using System;
using System.Collections.Generic;
public partial class Call
{
public Call()
{
this.Logs = new HashSet<Log>();
}
...
}
}
【问题讨论】:
标签: entity-framework constructor partial-classes ef-model-first