I tried adding to my code and I ended up doing this:
public MyTemplate(Microsoft.VisualStudio.TextTemplating.TextTransformation textTransformation)
: base(textTransformation) {}
protected override void WriteEntityDataPropertyAttributes(EdmPropertyWrapper property) {
if (property.Name == "intConcurrencyID") {
WriteAttribute("IbEm.ConcurrencyStrategy(IbEm.ConcurrencyStrategy.AutoIncrement)");
}
base.WriteEntityDataPropertyAttributes(property);
}
protected override void WriteDataEntityPropertyDefinition(EdmPropertyWrapper property)
{
if (property.Name == "intConcurrencyID")
{
WriteLine(String.Format("/// <summary>The {0} <see cref=\"T:IbEm.DataEntityProperty\"/>. </summary>", property.Name));
var type = property.IsNullable ? "System.Nullable<int>" : "int";
WriteLine(String.Format("public static readonly IbEm.DataEntityProperty<{0}, {1}> intConcurrencyID = new IbEm.DataEntityProperty<{0}, {1}>(\"intConcurrencyID\", {2}, false, IbEm.ConcurrencyStrategy.AutoIncrement, false, null);", property.ParentType.Name, type, property.IsNullable.ToString().ToLower()));
}
else
{
base.WriteDataEntityPropertyDefinition(property);
}
}
}
I was able to replace this part:
public static readonly IbEm.DataEntityProperty<tblSMSecurityListing, int> intConcurrencyID = new IbEm.DataEntityProperty<tblSMSecurityListing, int>("intConcurrencyID", false, false, IbEm.ConcurrencyStrategy.None, false, null);
However, concurrency is not yet working and I really need to configure it manually in the EDM designer by setting the columns' ConcurrencyStrategy and ConcurrencyMode for it to work properly.
I thought that EntityManager just look on the designer.cs stuffs to perform concurrency checking but it seems that edmx csdl should be sync with the code behinf or I just missed something here?
Thanks,
Von