private void CreateInitialEntity() { bcsModel = new BCSModel(); entity = new BCSEntity(); bcsModel.Entities.Add(entity); BCSField fieldID = new BCSField(); fieldID.DataType = typeof(System.Int32); fieldID.IsKey = true; fieldID.Name = "ID"; fieldID.DisplayName = "ID"; entity.Fields.Add(fieldID); BCSField fieldName = new BCSField(); fieldName.DataType = typeof(System.String); fieldName.Name = "Name"; fieldName.IsRequired = true; fieldName.DisplayName = "Name"; entity.Fields.Add(fieldName); BCSField fieldProperty = new BCSField(); fieldProperty.DataType = typeof(System.String); fieldProperty.Name = "Property1"; fieldProperty.DisplayName = "Property 1"; entity.Fields.Add(fieldProperty); }
private void AddField(BCSEntity entity, string name, string display, Type datatype, bool isKey, bool isIdentity, bool isRequired) { BCSField field = new BCSField(); field.Name = name; field.DisplayName = display; field.DataType = datatype; field.IsIdentity = isIdentity; field.IsKey = isKey; field.IsRequired = isRequired; entity.Fields.Add(field); }
private void AddEntity(BCSModel bcsModel, string name, string display) { BCSEntity entity = new BCSEntity(); entity.Name = name; entity.DisplayName = display; entity.CreateCreateOperation = true; entity.CreateDeleteOperation = true; entity.CreateReadOperation = true; entity.CreateUpdateOperation = true; bcsModel.Entities.Add(entity); AddField(entity, "Field1", "Field 1", typeof(System.Int32), true, true, false); AddField(entity, "Field2", "Field 2", typeof(System.String), false, false, false); AddField(entity, "Field3", "Field 3", typeof(System.String), false, false, true); }