public ClienteConfig(EntityTypeBuilder<Cliente> entityBuilder) { entityBuilder.HasKey(c => c.ClienteId); entityBuilder.Property(c => c.Nome) .IsRequired() .HasMaxLength(150); entityBuilder.Property(c => c.Email) .IsRequired() .HasMaxLength(100); entityBuilder.Property(c => c.CPF) .IsRequired() .HasMaxLength(11); //.HasAnnotation("Index", (new IndexAttribute() { IsUnique = true })); entityBuilder.Property(c => c.DataNascimento) .IsRequired(); entityBuilder.Property(c => c.Ativo) .IsRequired(); //Ignore(c => c.ValidationResult); entityBuilder.ToTable("Clientes"); }
public EnderecoConfig(EntityTypeBuilder<Endereco> entityBuilder) { entityBuilder.HasKey(e => e.EnderecoId); entityBuilder.Property(e => e.Logradouro) .IsRequired() .HasMaxLength(150); entityBuilder.Property(e => e.Numero) .IsRequired() .HasMaxLength(100); entityBuilder.Property(e => e.Bairro) .IsRequired() .HasMaxLength(50); entityBuilder.Property(e => e.CEP) .IsRequired() .HasMaxLength(8); entityBuilder.Property(e => e.Complemento) .HasMaxLength(100); entityBuilder.ToTable("Enderecos"); }
public DeviceConfiguration(EntityTypeBuilder<Device> entityBuilder) { /* entityBuilder .Property(d => d.TimeCreated) .ValueGeneratedOnAdd(); */ }
public static void Map(EntityTypeBuilder<Message> builder) { builder.ToTable("Message"); builder.HasKey(t => t.ID); builder.Property(t => t.ID).UseSqlServerIdentityColumn().ValueGeneratedOnAdd(); }
public static void ParseConstraints(EntityTypeBuilder entityBuilder, string statement) { var constraint = statement.Split(' ', '(')[0]; if (constraint.Equals("UNIQUE", StringComparison.OrdinalIgnoreCase)) { ParseInlineUniqueConstraint(entityBuilder, statement); } }
public static void Map(EntityTypeBuilder<UserCollect> builder) { builder.ForSqlServerToTable("UserCollect"); builder.HasKey(t => new { t.UserID, t.TopicID }); builder.HasOne(t => t.Topic).WithMany().HasForeignKey(t => t.TopicID); }
public static void Map(EntityTypeBuilder<Comment> builder) { builder.ToTable("Comment"); builder.HasKey(t => t.ID); builder.Property(t => t.ID).UseSqlServerIdentityColumn().ValueGeneratedOnAdd(); builder.Property(t => t.Content).IsRequired(); }
private static void MappingCategory(EntityTypeBuilder<Category> builder) { builder.ForSqlServer().Table("Category"); builder.Key(t => t.ID); builder.Property(t => t.ID).ForSqlServer().UseIdentity(); builder.Property(t => t.Name).Required().MaxLength(50); }
private static void MappingArticle(EntityTypeBuilder<Article> builder) { builder.ForSqlServer().Table("Article"); builder.Key(t => t.ID); builder.Property(t => t.ID).ForSqlServer().UseIdentity(); builder.Property(t => t.Title).MaxLength(100).Required(); builder.Property(t => t.From).MaxLength(50); builder.Reference(t => t.User); }
public ApplicationDbConfigurations(EntityTypeBuilder<Visit> visit, EntityTypeBuilder<Barber> barber) { // Visit Data Context Configuration visit.Property(v => v.VisitId) .UseSqlServerIdentityColumn(); visit.Property(v => v.isCheckedOff) .HasDefaultValue(false); // Barber Data Context Configuration }
public static void Map(EntityTypeBuilder<Topic> builder) { builder.ToTable("Topic"); builder.HasKey(t => t.ID); builder.Property(t => t.ID).UseSqlServerIdentityColumn().ValueGeneratedOnAdd(); builder.Property(t => t.Title).IsRequired().HasMaxLength(100); builder.Property(t => t.Content).IsRequired(); builder.Property(t => t.Category).IsRequired().HasMaxLength(50); }
public static void Map(EntityTypeBuilder<User> builder) { builder.ToTable("User"); builder.HasKey(t => t.ID); builder.Property(t => t.ID).UseSqlServerIdentityColumn().ValueGeneratedOnAdd(); builder.Property(t => t.UserName).IsRequired().HasMaxLength(20); builder.Property(t => t.Password).IsRequired().HasMaxLength(100); builder.Property(t => t.Email).IsRequired().HasMaxLength(100); builder.Property(t => t.Location).HasMaxLength(100); builder.Property(t => t.Signature).HasMaxLength(200); builder.Property(t => t.WebSite).HasMaxLength(100); }
public static void ParseColumnDefinition(EntityTypeBuilder entityBuilder, string statement) { var paramName = UnescapeString(SafeSplit(statement, ' ').First()); var prop = entityBuilder.Metadata.FindProperty(paramName); if (prop == null) { return; } if (statement.IndexOf(" UNIQUE", StringComparison.OrdinalIgnoreCase) > 0) { entityBuilder.Index(prop.Name).Unique(); } }
private static void MappingUser(EntityTypeBuilder<User> builder) { builder.ForSqlServer().Table("User"); builder.Key(t => t.ID); builder.Property(t => t.ID).ForSqlServer().UseIdentity(); builder.Property(t => t.UserName).Required().MaxLength(20); builder.Property(t => t.Password).Required().MaxLength(32); builder.Property(t => t.Nickname).Required().MaxLength(20); builder.Property(t => t.Email).Required().MaxLength(100); builder.Property(t => t.CreateDate).Required(); builder.Property(t => t.Avatar).MaxLength(100); builder.Property(t => t.Token).MaxLength(32); }
public static void Initialize(MetadataStore metadataStore) { var makeBuilder = new EntityTypeBuilder<Make>(metadataStore); makeBuilder.DataProperty(make => make.Id).IsPartOfKey(); makeBuilder.DataProperty(make => make.Name).MaxLength(40); // makeBuilder.NavigationProperty(make => make.Models).HasInverse(model => model.Make); var modelBuilder = new EntityTypeBuilder<Model>(metadataStore); modelBuilder.DataProperty(model => model.Id).IsPartOfKey(); modelBuilder.NavigationProperty(model => model.Make) .HasForeignKey(model => model.MakeId) .HasInverse(make => make.Models); }
public SocketConfiguration(EntityTypeBuilder<Socket> entityBuilder) { entityBuilder .HasOne(s => s.PointName) .WithOne(pn => pn.Socket) .HasForeignKey<PointName>(b => b.SocketId); entityBuilder .HasOne(s => s.Device) .WithMany(d => d.Sockets) .HasForeignKey(s => s.DeviceId); entityBuilder .HasOne(s => s.ConnectedSocket) .WithMany(s => s.ConnectedToSockets) .HasForeignKey(s => s.ConnectedToSocketId); }
public CustomerConfiguration(EntityTypeBuilder<Customer> builder) { builder.Property(x => x.Name) .HasMaxLength(100) .IsRequired(); builder.Property(x => x.FiscalIdentifier) .HasMaxLength(10); builder.Property(x => x.Street) .HasMaxLength(100) .IsRequired(); builder.Property(x => x.City) .HasMaxLength(80) .IsRequired(); builder.Property(x => x.PostalCode) .HasMaxLength(10); builder.Property(x => x.Region) .HasMaxLength(80); }
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> protected override PropertyBuilder VisitColumn(EntityTypeBuilder builder, ColumnModel column) { var propertyBuilder = base.VisitColumn(builder, column); if (propertyBuilder == null) { return null; } VisitTypeMapping(propertyBuilder, column); VisitDefaultValue(propertyBuilder, column); VisitComputedValue(propertyBuilder, column); return propertyBuilder; }
public void MetadataNeededToGetEntityKey() { // Metadata is necessary to get entity key // Must be first test to be meaningful, since CanFetchMetadata() below fetches // metadata into the static instance of MetadataStore var entityManager = new EntityManager(_serviceName); var customerType = entityManager.MetadataStore.GetEntityType(typeof(Customer)); Assert.IsNotNull(customerType); EntityKey key; try { key = new EntityKey(customerType, _alfredsID); Assert.Fail("EntityKey constructor should fail if metadata not fetched"); } catch (Exception e) { Assert.IsTrue(e.Message.Contains("There are no KeyProperties yet defined"), "Thrown exception should indicated key property is not defined. Instead it says \"" + e.Message + "\""); } var etb = new EntityTypeBuilder<Customer>(entityManager.MetadataStore); etb.DataProperty(c => c.CustomerID).IsPartOfKey(); key = new EntityKey(customerType, _alfredsID); }
public void Configure(EntityTypeBuilder <Patient> builder) { builder.Property(x => x.Email) .IsUnicode(false); }
public void Configure(EntityTypeBuilder <Role> builder) { builder.SetEntityConfig(); builder.Property(a => a.Name).HasMaxLength(200).IsRequired(); builder.Property(a => a.Memo); }
public void Configure(EntityTypeBuilder <Lecturer> builder) { throw new NotImplementedException(); }
public void Configure(EntityTypeBuilder <Color> builder) { builder .HasKey(x => x.ColorId); }
public void Configure(EntityTypeBuilder <Teacher> builder) { builder.Property(x => x.Id).IsRequired(); builder.Property(x => x.Email).IsRequired(); //builder.HasOne(x => x.ClassOfTeacher).WithOne(x => x.TeacherOfClassroom).HasForeignKey<Classroom>(x => x.TeacherId); }
public void Configure(EntityTypeBuilder <Department> builder) { builder.ToTable("Departments"); }
public void Configure(EntityTypeBuilder <Shop> builder) { builder.Property(b => b.Id).ValueGeneratedOnAdd(); builder.Property(b => b.Code).HasMaxLength(10); builder.Property(b => b.Description).HasMaxLength(30); }
public void Configure(EntityTypeBuilder <Section> builder) { builder.HasKey(x => x.SectionId); // This one would be picked up by convention ({ClassnameId} would be autodetected, but this is a good example of configuring. }
public void Configure(EntityTypeBuilder <EmailEvent> builder) { builder.ToTable("EmailEvents", "public"); }
public void Configure(EntityTypeBuilder <ClientRequest> builder) { builder.HasKey(x => x.Id); builder.Property(x => x.Name).IsRequired(); builder.Property(x => x.Time).IsRequired(); }
/// <summary> /// Developers can override this method in custom partial classes /// in order to add some custom initialization code to constructors /// </summary> protected virtual void PostInitialize(EntityTypeBuilder <T> builder) { }
public void Configure(EntityTypeBuilder <Fluent_BookDetail> modelBuilder) { // Fluent - BookDetails modelBuilder.HasKey(b => b.BookDetail_Id); modelBuilder.Property(b => b.NumberOfChapters).IsRequired(); }
public override void Configure(EntityTypeBuilder <AdvertistmentPage> entity) { entity.Property(c => c.Id).IsRequired().HasColumnType("varchar(250)"); }
public void Configure(EntityTypeBuilder <BlockedUser> builder) { }
/// <summary> /// 重写以实现实体类型各个属性的数据库配置 /// </summary> /// <param name="builder">实体类型创建器</param> public override void Configure(EntityTypeBuilder <UserRole> builder) { builder.HasIndex(m => new { m.UserId, m.RoleId }).HasName("UserRoleIndex").IsUnique(); builder.HasOne <Role>().WithMany().HasForeignKey(m => m.RoleId); builder.HasOne <User>().WithMany().HasForeignKey(m => m.UserId); }
public void Configure(EntityTypeBuilder <CircuitBreakerLog> builder) { builder.ToTable("CircuitBreakerLogs"); }
public void Configure(EntityTypeBuilder <Section> builder) { builder.HasKey(e => e.Code); builder.Property(e => e.Code).HasMaxLength(25); }
public void Configure(EntityTypeBuilder <RoleGroup> builder) { builder.ToTable("RoleGroups", "SSO"); builder.Property(b => b.Title).HasMaxLength(50); }
public void Configure(EntityTypeBuilder <Customer> builder) { builder.HasIndex(e => new { e.BranchId, e.Name }) .HasName("IX_Customer") .IsUnique(); builder.HasIndex(e => new { e.Id, e.Name, e.Type, e.Status, e.EmployeesNum, e.Telphone, e.SalesId, e.PayMethod, e.CreditDays, e.BranchId, e.PayType }) .HasName("<Name of Missing Index, sysname,>"); builder.Property(e => e.AddTime) .HasColumnType("datetime") .HasDefaultValueSql("(getdate())"); builder.Property(e => e.Address) .HasMaxLength(200) .IsUnicode(false); builder.Property(e => e.Area) .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.Balance).HasColumnType("money"); builder.Property(e => e.BalanceType).HasDefaultValueSql("((1))"); builder.Property(e => e.BranchId).HasDefaultValueSql("((1))"); builder.Property(e => e.City) .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.ConfirmLevel) .HasDefaultValueSql("((5))") .HasComment("审核下单level"); builder.Property(e => e.Credit).HasComment("信用额度"); builder.Property(e => e.CreditDays).HasComment("账期"); builder.Property(e => e.EmailForInvoice) .HasMaxLength(200) .IsUnicode(false); builder.Property(e => e.EmployeesNum) .HasMaxLength(100) .IsUnicode(false); builder.Property(e => e.EndTime).HasColumnType("datetime"); builder.Property(e => e.Fax) .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.InvoiceAddress) .HasMaxLength(500) .IsUnicode(false); builder.Property(e => e.InvoiceBank) .HasMaxLength(100) .IsUnicode(false); builder.Property(e => e.InvoiceBankAccount) .HasMaxLength(100) .IsUnicode(false); builder.Property(e => e.InvoiceCategory) .IsRequired() .HasMaxLength(50) .IsUnicode(false) .HasDefaultValueSql("('纸质发票')"); builder.Property(e => e.InvoiceContent) .IsRequired() .HasMaxLength(100) .IsUnicode(false) .HasDefaultValueSql("('')"); builder.Property(e => e.InvoiceMemo) .HasMaxLength(200) .IsUnicode(false); builder.Property(e => e.InvoiceName) .HasMaxLength(200) .IsUnicode(false); builder.Property(e => e.InvoicePhone) .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.InvoiceTaxNo) .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.InvoiceType) .IsRequired() .HasMaxLength(50) .IsUnicode(false) .HasComment("增票,普票,收据,无需发票"); builder.Property(e => e.IsBudget).HasComment("是否启用预算管理"); builder.Property(e => e.IsBuyOutCounter).HasComment("是否可以买专柜以外的商品"); builder.Property(e => e.IsComfirmOrder).HasComment("是否启用审核下单"); builder.Property(e => e.IsCounter).HasComment("是否启用专柜"); builder.Property(e => e.IsDisable).HasDefaultValueSql("((0))"); builder.Property(e => e.IsMultiAccount) .IsRequired() .HasDefaultValueSql("((1))") .HasComment("是否启用多账号"); builder.Property(e => e.IsOrdering).HasComment("1:开启连续下单状态"); builder.Property(e => e.IsStoreManager).HasComment("是否启用库存管理"); builder.Property(e => e.Level) .HasDefaultValueSql("((3))") .HasComment("客户级别:1-5,5最高"); builder.Property(e => e.Memo).HasMaxLength(1000); builder.Property(e => e.Name) .IsRequired() .HasMaxLength(200) .IsUnicode(false); builder.Property(e => e.OrderDiscount) .HasDefaultValueSql("((100))") .HasComment("默认的折扣,对专柜也有效!"); builder.Property(e => e.OrderMemo) .HasMaxLength(200) .IsUnicode(false) .HasComment("开单特殊说明"); builder.Property(e => e.OrderPrintNum) .HasDefaultValueSql("((2))") .HasComment("订单打印份数"); builder.Property(e => e.PayMethod) .HasMaxLength(50) .IsUnicode(false) .HasComment("支票,现金,电汇,其它"); builder.Property(e => e.PayType) .HasMaxLength(50) .IsUnicode(false) .HasComment("现结,月结"); builder.Property(e => e.PostCode) .HasMaxLength(6) .IsUnicode(false); builder.Property(e => e.Province) .HasMaxLength(100) .IsUnicode(false); builder.Property(e => e.Py) .HasColumnName("PY") .HasMaxLength(500) .IsUnicode(false); builder.Property(e => e.RegisterMethod) .IsRequired() .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.SalesId).HasComment("默认销售员"); builder.Property(e => e.ServiceId).HasComment("客服"); builder.Property(e => e.ShortName) .HasMaxLength(100) .IsUnicode(false); builder.Property(e => e.StartTime).HasColumnType("datetime"); builder.Property(e => e.StatementManId).HasComment("对账员"); builder.Property(e => e.StatementMemo) .HasMaxLength(200) .IsUnicode(false) .HasComment("对账备注"); builder.Property(e => e.Status) .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.StoreMemo) .HasMaxLength(200) .IsUnicode(false) .HasComment("理货特殊说明"); builder.Property(e => e.Telphone) .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.Type) .HasMaxLength(50) .IsUnicode(false); builder.Property(e => e.UpdateTime) .HasColumnType("datetime") .HasDefaultValueSql("(getdate())"); builder.Property(e => e.Website) .HasMaxLength(200) .IsUnicode(false); }
public void Configure(EntityTypeBuilder <Attachment> entity) { entity.HasKey(p => p.AttachmentID); }
/// <summary> /// 映射表 /// </summary> protected override void MapTable(EntityTypeBuilder <Application> builder) { builder.ToTable("Application", "Systems"); }
public void Configure(EntityTypeBuilder <Project> builder) { }
/// <summary> /// /// </summary> /// <param name="builder"></param> public void Configure(EntityTypeBuilder <Account> builder) { #region 水平拆分处理处 EntityTypeBuilder <Account> tableBuilder = builder.ToTable("Account"); tableBuilder.HasMany <AccountRole>(p => p.AccountRoles) .WithOne(c => c.account) .HasForeignKey(c => c.AccountId); tableBuilder.HasMany <AccountIdentityAuth>(p => p.AccountIdentityAuths) .WithOne(c => c.account) .HasForeignKey(c => c.AccountId); //tableBuilder.Ha tableBuilder.Property(x => x.Sex).HasDefaultValue(null); tableBuilder.Property(x => x.DisplayName).HasDefaultValue("Account"); tableBuilder.Property(x => x.Avatar).HasDefaultValue(""); tableBuilder.Property(x => x.Introduction).HasDefaultValue(""); tableBuilder.Property(x => x.AccountState).HasDefaultValue(1).IsRequired(true); tableBuilder.HasIndex(x => x.Username).IsUnique(true); tableBuilder.HasIndex(x => x.Passport).IsUnique(true); tableBuilder.HasIndex(x => x.Email).IsUnique(true); tableBuilder.HasIndex(x => new { x.Phone, x.PhoneAreaCode }).IsUnique(true); #endregion IList <Account> default_data = new List <Account> { new Account { Id = 1, DisplayName = "Admin", Email = "*****@*****.**".ToLower(), PhoneAreaCode = "86", Phone = "18412345678", Passport = "Passport_Admin".ToLower(), Username = "******", Password = "******", Sex = null, }, new Account { Id = 2, DisplayName = "Developer", Email = "*****@*****.**".ToLower(), PhoneAreaCode = "86", Phone = "13712345678", Passport = "Passport_Developer".ToLower(), Username = "******", Password = "******", Sex = null, }, new Account { Id = 3, DisplayName = "Guest", Email = "*****@*****.**".ToLower(), Passport = "Passport_Guest".ToLower(), Username = "******", Password = "******", Sex = null, } }; builder.HasData(default_data); builder.SetupBaseEntity(); }
public void Configure(EntityTypeBuilder <Translate> builder) { builder.HasKey(x => x.Id); builder.Property(x => x.LangId).IsRequired(); builder.Property(x => x.Code).HasMaxLength(50).IsRequired(); builder.Property(x => x.Value).HasMaxLength(500).IsRequired(); builder.HasData( new Translate { Id = 1, LangId = 1, Code = "Login", Value = "Giriş" }, new Translate { Id = 2, LangId = 1, Code = "Email", Value = "E posta" }, new Translate { Id = 3, LangId = 1, Code = "Password", Value = "Parola" }, new Translate { Id = 4, LangId = 1, Code = "Update", Value = "Güncelle" }, new Translate { Id = 5, LangId = 1, Code = "Delete", Value = "Sil" }, new Translate { Id = 6, LangId = 1, Code = "UsersGroups", Value = "Kullanıcının Grupları" }, new Translate { Id = 7, LangId = 1, Code = "UsersClaims", Value = "Kullanıcının Yetkileri" }, new Translate { Id = 8, LangId = 1, Code = "Create", Value = "Yeni" }, new Translate { Id = 9, LangId = 1, Code = "Users", Value = "Kullanıcılar" }, new Translate { Id = 10, LangId = 1, Code = "Groups", Value = "Gruplar" }, new Translate { Id = 11, LangId = 2, Code = "Login", Value = "Login" }, new Translate { Id = 12, LangId = 2, Code = "Email", Value = "Email" }, new Translate { Id = 13, LangId = 2, Code = "Password", Value = "Password" }, new Translate { Id = 14, LangId = 2, Code = "Update", Value = "Update" }, new Translate { Id = 15, LangId = 2, Code = "Delete", Value = "Delete" }, new Translate { Id = 16, LangId = 2, Code = "UsersGroups", Value = "User's Groups" }, new Translate { Id = 17, LangId = 2, Code = "UsersClaims", Value = "User's Claims" }, new Translate { Id = 18, LangId = 2, Code = "Create", Value = "Create" }, new Translate { Id = 19, LangId = 2, Code = "Users", Value = "Users" }, new Translate { Id = 20, LangId = 2, Code = "Groups", Value = "Groups" }, new Translate { Id = 21, LangId = 1, Code = "OperationClaim", Value = "Operasyon Yetkileri" }, new Translate { Id = 22, LangId = 2, Code = "OperationClaim", Value = "Operation Claim" }, new Translate { Id = 23, LangId = 1, Code = "Languages", Value = "Diller" }, new Translate { Id = 24, LangId = 2, Code = "Languages", Value = "Languages" }, new Translate { Id = 25, LangId = 1, Code = "TranslateWords", Value = "Dil Çevirileri" }, new Translate { Id = 26, LangId = 2, Code = "TranslateWords", Value = "Translate Words" }, new Translate { Id = 27, LangId = 1, Code = "Management", Value = "Yönetim" }, new Translate { Id = 28, LangId = 2, Code = "Management", Value = "Management" }, new Translate { Id = 29, LangId = 1, Code = "AppMenu", Value = "Uygulama" }, new Translate { Id = 30, LangId = 2, Code = "AppMenu", Value = "Application" }, new Translate { Id = 31, LangId = 1, Code = "Added", Value = "Başarıyla Eklendi." }, new Translate { Id = 32, LangId = 2, Code = "Added", Value = "Successfully Added." }, new Translate { Id = 33, LangId = 1, Code = "Updated", Value = "Başarıyla Güncellendi." }, new Translate { Id = 34, LangId = 2, Code = "Updated", Value = "Successfully Updated." }, new Translate { Id = 35, LangId = 1, Code = "Deleted", Value = "Başarıyla Silindi." }, new Translate { Id = 36, LangId = 2, Code = "Deleted", Value = "Successfully Deleted." }, new Translate { Id = 37, LangId = 1, Code = "OperationClaimExists", Value = "Bu operasyon izni zaten mevcut." }, new Translate { Id = 38, LangId = 2, Code = "OperationClaimExists", Value = "This operation permit already exists." }, new Translate { Id = 39, LangId = 1, Code = "StringLengthMustBeGreaterThanThree", Value = "Lütfen En Az 3 Karakterden Oluşan Bir İfade Girin." }, new Translate { Id = 40, LangId = 2, Code = "StringLengthMustBeGreaterThanThree", Value = "Please Enter A Phrase Of At Least 3 Characters." }, new Translate { Id = 41, LangId = 1, Code = "CouldNotBeVerifyCid", Value = "Kimlik No Doğrulanamadı." }, new Translate { Id = 42, LangId = 2, Code = "CouldNotBeVerifyCid", Value = "Could not be verify Citizen Id" }, new Translate { Id = 43, LangId = 1, Code = "VerifyCid", Value = "Kimlik No Doğrulandı." }, new Translate { Id = 44, LangId = 2, Code = "VerifyCid", Value = "Verify Citizen Id" }, new Translate { Id = 45, LangId = 1, Code = "AuthorizationsDenied", Value = "Yetkiniz olmayan bir alana girmeye çalıştığınız tespit edildi." }, new Translate { Id = 46, LangId = 2, Code = "AuthorizationsDenied", Value = "It has been detected that you are trying to enter an area that you do not have authorization." }, new Translate { Id = 47, LangId = 1, Code = "UserNotFound", Value = "Kimlik Bilgileri Doğrulanamadı. Lütfen Yeni Kayıt Ekranını kullanın." }, new Translate { Id = 48, LangId = 2, Code = "UserNotFound", Value = "Credentials Could Not Verify. Please use the New Registration Screen." }, new Translate { Id = 49, LangId = 1, Code = "PasswordError", Value = "Kimlik Bilgileri Doğrulanamadı, Kullanıcı adı ve/veya parola hatalı." }, new Translate { Id = 50, LangId = 2, Code = "PasswordError", Value = "Credentials Failed to Authenticate, Username and / or password incorrect." }, new Translate { Id = 51, LangId = 1, Code = "SuccessfulLogin", Value = "Sisteme giriş başarılı." }, new Translate { Id = 52, LangId = 2, Code = "SuccessfulLogin", Value = "Login to the system is successful." }, new Translate { Id = 53, LangId = 1, Code = "SendMobileCode", Value = "Lütfen Size SMS Olarak Gönderilen Kodu Girin!" }, new Translate { Id = 54, LangId = 2, Code = "SendMobileCode", Value = "Please Enter The Code Sent To You By SMS!" }, new Translate { Id = 55, LangId = 1, Code = "NameAlreadyExist", Value = "Oluşturmaya Çalıştığınız Nesne Zaten Var." }, new Translate { Id = 56, LangId = 2, Code = "NameAlreadyExist", Value = "The Object You Are Trying To Create Already Exists." }, new Translate { Id = 57, LangId = 1, Code = "WrongCID", Value = "Vatandaşlık No Sistemimizde Bulunamadı. Lütfen Yeni Kayıt Oluşturun!" }, new Translate { Id = 58, LangId = 2, Code = "WrongCID", Value = "Citizenship Number Not Found In Our System. Please Create New Registration!" }, new Translate { Id = 59, LangId = 1, Code = "CID", Value = "Vatandaşlık No" }, new Translate { Id = 60, LangId = 2, Code = "CID", Value = "Citizenship Number" }, new Translate { Id = 61, LangId = 1, Code = "PasswordEmpty", Value = "Parola boş olamaz!" }, new Translate { Id = 62, LangId = 2, Code = "PasswordEmpty", Value = "Password can not be empty!" }, new Translate { Id = 63, LangId = 1, Code = "PasswordLength", Value = "Minimum 8 Karakter Uzunluğunda Olmalıdır!" }, new Translate { Id = 64, LangId = 2, Code = "PasswordLength", Value = "Must be at least 8 characters long! " }, new Translate { Id = 65, LangId = 1, Code = "PasswordUppercaseLetter", Value = "En Az 1 Büyük Harf İçermelidir!" }, new Translate { Id = 66, LangId = 2, Code = "PasswordUppercaseLetter", Value = "Must Contain At Least 1 Capital Letter!" }, new Translate { Id = 67, LangId = 1, Code = "PasswordLowercaseLetter", Value = "En Az 1 Küçük Harf İçermelidir!" }, new Translate { Id = 68, LangId = 2, Code = "PasswordLowercaseLetter", Value = "Must Contain At Least 1 Lowercase Letter!" }, new Translate { Id = 69, LangId = 1, Code = "PasswordDigit", Value = "En Az 1 Rakam İçermelidir!" }, new Translate { Id = 70, LangId = 2, Code = "PasswordDigit", Value = "It Must Contain At Least 1 Digit!" }, new Translate { Id = 71, LangId = 1, Code = "PasswordSpecialCharacter", Value = "En Az 1 Simge İçermelidir!" }, new Translate { Id = 72, LangId = 2, Code = "PasswordSpecialCharacter", Value = "Must Contain At Least 1 Symbol!" }, new Translate { Id = 73, LangId = 1, Code = "SendPassword", Value = "Yeni Parolanız E-Posta Adresinize Gönderildi." }, new Translate { Id = 74, LangId = 2, Code = "SendPassword", Value = "Your new password has been sent to your e-mail address." }, new Translate { Id = 75, LangId = 1, Code = "InvalidCode", Value = "Geçersiz Bir Kod Girdiniz!" }, new Translate { Id = 76, LangId = 2, Code = "InvalidCode", Value = "You Entered An Invalid Code!" }, new Translate { Id = 77, LangId = 1, Code = "SmsServiceNotFound", Value = "SMS Servisine Ulaşılamıyor." }, new Translate { Id = 78, LangId = 2, Code = "SmsServiceNotFound", Value = "Unable to Reach SMS Service." }, new Translate { Id = 79, LangId = 1, Code = "TrueButCellPhone", Value = "Bilgiler doğru. Cep telefonu gerekiyor." }, new Translate { Id = 80, LangId = 2, Code = "TrueButCellPhone", Value = "The information is correct. Cell phone is required." }, new Translate { Id = 81, LangId = 1, Code = "TokenProviderException", Value = "Token Provider boş olamaz!" }, new Translate { Id = 82, LangId = 2, Code = "TokenProviderException", Value = "Token Provider cannot be empty!" }, new Translate { Id = 83, LangId = 1, Code = "Unknown", Value = "Bilinmiyor!" }, new Translate { Id = 84, LangId = 2, Code = "Unknown", Value = "Unknown!" }, new Translate { Id = 85, LangId = 1, Code = "NewPassword", Value = "Yeni Parola:" }, new Translate { Id = 86, LangId = 2, Code = "NewPassword", Value = "New Password:"******"ChangePassword", Value = "Parola Değiştir" }, new Translate { Id = 88, LangId = 2, Code = "ChangePassword", Value = "Change Password" }, new Translate { Id = 89, LangId = 1, Code = "Save", Value = "Kaydet" }, new Translate { Id = 90, LangId = 2, Code = "Save", Value = "Save" }, new Translate { Id = 91, LangId = 1, Code = "GroupName", Value = "Grup Adı" }, new Translate { Id = 92, LangId = 2, Code = "GroupName", Value = "Group Name" }, new Translate { Id = 93, LangId = 1, Code = "FullName", Value = "Tam Adı" }, new Translate { Id = 94, LangId = 2, Code = "FullName", Value = "Full Name" }, new Translate { Id = 95, LangId = 1, Code = "Address", Value = "Adres" }, new Translate { Id = 96, LangId = 2, Code = "Address", Value = "Address" }, new Translate { Id = 97, LangId = 1, Code = "Notes", Value = "Notlar" }, new Translate { Id = 98, LangId = 2, Code = "Notes", Value = "Notes" }, new Translate { Id = 99, LangId = 1, Code = "ConfirmPassword", Value = "Parolayı Doğrula" }, new Translate { Id = 100, LangId = 2, Code = "ConfirmPassword", Value = "Confirm Password" }, new Translate { Id = 101, LangId = 1, Code = "Code", Value = "Kod" }, new Translate { Id = 102, LangId = 2, Code = "Code", Value = "Code" }, new Translate { Id = 103, LangId = 1, Code = "Alias", Value = "Görünen Ad" }, new Translate { Id = 104, LangId = 2, Code = "Alias", Value = "Alias" }, new Translate { Id = 105, LangId = 1, Code = "Description", Value = "Açıklama" }, new Translate { Id = 106, LangId = 2, Code = "Description", Value = "Description" }, new Translate { Id = 107, LangId = 1, Code = "Value", Value = "Değer" }, new Translate { Id = 108, LangId = 2, Code = "Value", Value = "Value" }, new Translate { Id = 109, LangId = 1, Code = "LangCode", Value = "Dil Kodu" }, new Translate { Id = 110, LangId = 2, Code = "LangCode", Value = "Lang Code" }, new Translate { Id = 111, LangId = 1, Code = "Name", Value = "Adı" }, new Translate { Id = 112, LangId = 2, Code = "Name", Value = "Name" }, new Translate { Id = 113, LangId = 1, Code = "MobilePhones", Value = "Cep Telefonu" }, new Translate { Id = 114, LangId = 2, Code = "MobilePhones", Value = "Mobile Phone" }, new Translate { Id = 115, LangId = 1, Code = "NoRecordsFound", Value = "Kayıt Bulunamadı" }, new Translate { Id = 116, LangId = 2, Code = "NoRecordsFound", Value = "No Records Found" }, new Translate { Id = 117, LangId = 1, Code = "Required", Value = "Bu alan zorunludur!" }, new Translate { Id = 118, LangId = 2, Code = "Required", Value = "This field is required!" }, new Translate { Id = 119, LangId = 1, Code = "Permissions", Value = "Permissions" }, new Translate { Id = 120, LangId = 2, Code = "Permissions", Value = "İzinler" }, new Translate { Id = 121, LangId = 1, Code = "GroupList", Value = "Grup Listesi" }, new Translate { Id = 122, LangId = 2, Code = "GroupList", Value = "Group List" }, new Translate { Id = 123, LangId = 1, Code = "GrupPermissions", Value = "Grup Yetkileri" }, new Translate { Id = 124, LangId = 2, Code = "GrupPermissions", Value = "Grup Permissions" }, new Translate { Id = 125, LangId = 1, Code = "Add", Value = "Ekle" }, new Translate { Id = 126, LangId = 2, Code = "Add", Value = "Add" }, new Translate { Id = 127, LangId = 1, Code = "UserList", Value = "Kullanıcı Listesi" }, new Translate { Id = 128, LangId = 2, Code = "UserList", Value = "User List" }, new Translate { Id = 129, LangId = 1, Code = "OperationClaimList", Value = "Yetki Listesi" }, new Translate { Id = 130, LangId = 2, Code = "OperationClaimList", Value = "OperationClaim List" }, new Translate { Id = 131, LangId = 1, Code = "LanguageList", Value = "Dil Listesi" }, new Translate { Id = 132, LangId = 2, Code = "LanguageList", Value = "Language List" }, new Translate { Id = 133, LangId = 1, Code = "TranslateList", Value = "Dil Çeviri Listesi" }, new Translate { Id = 134, LangId = 2, Code = "TranslateList", Value = "Translate List" }, new Translate { Id = 135, LangId = 1, Code = "LogList", Value = "İşlem Kütüğü" }, new Translate { Id = 136, LangId = 2, Code = "LogList", Value = "LogList" }); }
public void Configure(EntityTypeBuilder <MixRelatedData> entity) { entity.HasKey(e => new { e.Id, e.Specificulture }) .HasName("PK_mix_related_data"); entity.ToTable("mix_related_data"); entity.Property(e => e.Id) .ValueGeneratedNever(); entity.Property(e => e.Specificulture) .HasColumnType("varchar(10)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); entity.Property(e => e.AttributeSetName) .HasColumnType("varchar(250)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); entity.Property(e => e.CreatedBy) .HasColumnType("varchar(50)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); entity.Property(e => e.CreatedDateTime).HasColumnType("datetime"); entity.Property(e => e.DataId) .IsRequired() .HasColumnType("varchar(50)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); entity.Property(e => e.Description) .HasColumnType("varchar(450)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); entity.Property(e => e.LastModified).HasColumnType("datetime"); entity.Property(e => e.ModifiedBy) .HasColumnType("varchar(50)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); entity.Property(e => e.ParentId) .IsRequired() .HasColumnType("varchar(50)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); entity.Property(e => e.ParentType) .IsRequired() .HasColumnType("varchar(50)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); entity.Property(e => e.Status) .IsRequired() .HasConversion(new EnumToStringConverter <MixEnums.MixContentStatus>()) .HasColumnType("varchar(50)") .HasCharSet("utf8") .HasCollation("Vietnamese_CI_AS"); }
public void Configure(EntityTypeBuilder <T> builder) { PostInitialize(builder); }
public static void Map(EntityTypeBuilder<CommentVote> builder) { builder.ToTable("CommentVote"); builder.HasKey(t => new { t.UserID, t.CommentID }); }
private void AssertIsGeneric(EntityTypeBuilder<Customer> _) { }
public static void Map(EntityTypeBuilder<TopicCollect> builder) { builder.ToTable("TopicCollect"); builder.HasKey(t => new { t.UserID, t.TopicID }); }
public static void ParseInlineUniqueConstraint(EntityTypeBuilder entityBuilder, string statement) { var start = statement.IndexOf('(') + 1; var paramChunk = statement.Substring(start, statement.LastIndexOf(')') - start); var props = SafeSplit(paramChunk, ',') .Select(UnescapeString) .ToList(); var index = entityBuilder.Metadata.Indexes.FirstOrDefault(i => { if (!i.Sqlite().Name.StartsWith("sqlite_autoindex")) { return false; } foreach (var prop in props) { if (!i.Properties.Any(p => p.Sqlite().ColumnName.Equals(prop, StringComparison.OrdinalIgnoreCase))) { return false; } } return true; }); if (index != null) { index.IsUnique = true; } }
public void Configure(EntityTypeBuilder <Color> builder) { builder.HasAlternateKey(n => n.Name); builder.Property(n => n.Name) .IsUnicode(); }
// this entity is not part of models is just needed for a join table public void Map(EntityTypeBuilder<UserRole> entity) { entity.ToTable("mp_UserRoles"); entity.HasKey(p => p.Id); entity.Property(p => p.Id) //.HasSqlServerColumnType("int") .UseSqlServerIdentityColumn() .HasColumnName("ID") //.Metadata.SentinelValue = -1 ; entity.Property(p => p.UserId) .ForSqlServerHasColumnType("int") .HasColumnName("UserID") .IsRequired() ; entity.Property(p => p.UserGuid) .ForSqlServerHasColumnType("uniqueidentifier") //.Metadata.SentinelValue = Guid.Empty ; entity.Property(p => p.RoleId) .ForSqlServerHasColumnType("int") .HasColumnName("RoleID") .IsRequired() ; entity.Property(p => p.RoleGuid) .ForSqlServerHasColumnType("uniqueidentifier") //.Metadata.SentinelValue = Guid.Empty ; }
public static void Initialize(MetadataStore metadataStore) { // Configure keys and relationships var personBuilder = new EntityTypeBuilder<Person>(metadataStore); personBuilder.DataProperty(person => person.Id).IsPartOfKey(); var sessionBuilder = new EntityTypeBuilder<Session>(metadataStore); sessionBuilder.DataProperty(session => session.Id).IsPartOfKey().IsAutoIncrementing(); sessionBuilder.NavigationProperty(session => session.Room) .HasForeignKey(session => session.RoomId); sessionBuilder.NavigationProperty(session => session.TimeSlot) .HasForeignKey(session => session.TimeSlotId); sessionBuilder.NavigationProperty(session => session.Track) .HasForeignKey(session => session.TrackId); sessionBuilder.NavigationProperty(session => session.Speaker) .HasForeignKey(session => session.SpeakerId) .HasInverse(speaker => speaker.SpeakerSessions); var roomBuilder = new EntityTypeBuilder<Room>(metadataStore); roomBuilder.DataProperty(room => room.Id).IsPartOfKey().IsAutoIncrementing(); var timeSlotBuilder = new EntityTypeBuilder<TimeSlot>(metadataStore); timeSlotBuilder.DataProperty(timeSlot => timeSlot.Id).IsPartOfKey().IsAutoIncrementing(); var trackBuilder = new EntityTypeBuilder<Track>(metadataStore); timeSlotBuilder.DataProperty(track => track.Id).IsPartOfKey().IsAutoIncrementing(); // Configure constraints personBuilder.DataProperty(person => person.FirstName).IsRequired().MaxLength(50); personBuilder.DataProperty(person => person.LastName).IsRequired().MaxLength(50); sessionBuilder.DataProperty(session => session.TrackId).IsRequired(); sessionBuilder.DataProperty(session => session.RoomId).IsRequired(); sessionBuilder.DataProperty(session => session.SpeakerId).IsRequired(); sessionBuilder.DataProperty(session => session.RoomId).IsRequired(); sessionBuilder.DataProperty(session => session.Title).IsRequired().MaxLength(50); sessionBuilder.DataProperty(session => session.Description).MaxLength(4000); }
public void Map(EntityTypeBuilder<Language> entity) { entity.ToTable("mp_Language"); entity.HasKey(p => p.Guid); entity.Property(p => p.Guid) .ForSqlServerHasColumnType("uniqueidentifier") .ForSqlServerHasDefaultValueSql("newid()") .IsRequired() ; entity.Property(p => p.Name) .HasMaxLength(255) .IsRequired() ; entity.Property(p => p.Code) .HasMaxLength(2) .IsRequired() ; entity.Property(p => p.Sort) .ForSqlServerHasColumnType("int") .ForSqlServerHasDefaultValue(1) .IsRequired() ; }
public void Map(EntityTypeBuilder<UserLocation> entity) { entity.ToTable("mp_UserLocation"); entity.HasKey(p => p.RowId); entity.Property(p => p.RowId) .ForSqlServerHasColumnType("uniqueidentifier") .ForSqlServerHasDefaultValueSql("newid()") .HasColumnName("RowID") ; entity.Property(p => p.UserGuid) .ForSqlServerHasColumnType("uniqueidentifier") ; entity.Property(p => p.SiteGuid) .ForSqlServerHasColumnType("uniqueidentifier") ; entity.Property(p => p.IpAddress) .HasColumnName("IPAddress") .HasMaxLength(50) ; entity.Property(p => p.IpAddressLong) .HasColumnName("IPAddressLong") ; entity.Property(p => p.Isp) .HasColumnName("ISP") .HasMaxLength(255) ; entity.Property(p => p.Continent) .HasMaxLength(255) ; entity.Property(p => p.Country) .HasMaxLength(255) ; entity.Property(p => p.Region) .HasMaxLength(255) ; entity.Property(p => p.City) .HasMaxLength(255) ; entity.Property(p => p.TimeZone) .HasMaxLength(255) ; entity.Property(p => p.FirstCaptureUtc) .HasColumnName("FirstCaptureUTC") ; entity.Property(p => p.LastCaptureUtc) .HasColumnName("LastCaptureUTC") ; entity.Property(p => p.Latitude) .ForSqlServerHasColumnType("float") ; entity.Property(p => p.Longitude) .ForSqlServerHasColumnType("float") ; entity.Property(p => p.HostName) .HasMaxLength(255) ; entity.HasIndex(p => p.UserGuid); // goode idea or not? //entity.HasIndex(p => p.Latitude); //entity.HasIndex(p => p.Longitude); }
public void Configure(EntityTypeBuilder <DeliveryMethod> builder) { builder.Property(d => d.Price).HasColumnType("decimal(18,2)"); }
public void Configure(EntityTypeBuilder <Yazi> builder) { builder.HasMany(i => i.YaziKategoris).WithOne(i => i.Yazi).HasForeignKey(i => i.YaziId); builder.HasOne(i => i.AppUser).WithMany(i => i.Yazis).HasForeignKey(i => i.AppUserId); }
public void Configure(EntityTypeBuilder <UsuarioGrupo> builder) { builder.HasKey(a => new { a.UsuarioId, a.GrupoId }); builder.Property(a => a.DataCriacao); builder.Property(a => a.EhAdministrador); }
public async Task CreateEntityWithAutoGeneratedStringKey() { var serviceName = "http://localhost:56337/breeze/Todos/"; var manager = new EntityManager(serviceName); // Hack to make string-valued Id the key var metadataStore = manager.MetadataStore; var entityType = new EntityTypeBuilder<StringKey>(metadataStore).EntityType; var idProperty = entityType.GetProperty("Id") as DataProperty; idProperty.IsPartOfKey = true; // Currently this throws because no GetNextTempValue delegate is defined for type String var newStringKey = manager.CreateEntity<StringKey>(); }
public static void Map(EntityTypeBuilder<Topic> builder) { builder.ForSqlServerToTable("Topic"); builder.HasKey(t => t.ID); builder.Property(t => t.ID).UseSqlServerIdentityColumn(); builder.Property(t => t.Title).IsRequired().HasMaxLength(100); builder.Property(t => t.Content).IsRequired(); builder.Property(t => t.Category).IsRequired().HasMaxLength(50); builder.HasOne(t => t.CreateUser).WithMany().HasForeignKey(t => t.CreateUserID).OnDelete(DeleteBehavior.Restrict); builder.HasOne(t => t.LastReplyUser).WithMany().HasForeignKey(t => t.LastReplyUserID).OnDelete(DeleteBehavior.Restrict); builder.Ignore(t => t.CategoryModel); }
public void Map(EntityTypeBuilder<Currency> entity) { entity.ToTable("mp_Currency"); entity.HasKey(p => p.Guid); entity.Property(p => p.Guid) .ForSqlServerHasColumnType("uniqueidentifier") .ForSqlServerHasDefaultValueSql("newid()") .IsRequired() ; entity.Property(p => p.Title) .HasMaxLength(50) .IsRequired() ; entity.Property(p => p.Code) .HasMaxLength(3) .IsRequired() ; entity.Property(p => p.SymbolLeft) .HasMaxLength(15) ; entity.Property(p => p.SymbolRight) .HasMaxLength(15) ; entity.Property(p => p.DecimalPointChar) .HasMaxLength(1) ; entity.Property(p => p.ThousandsPointChar) .HasMaxLength(1) ; entity.Property(p => p.DecimalPlaces) .HasMaxLength(1) ; entity.Property(p => p.LastModified) .ForSqlServerHasColumnType("datetime") .ForSqlServerHasDefaultValueSql("getutcdate()") ; entity.Property(p => p.Created) .ForSqlServerHasColumnType("datetime") .ForSqlServerHasDefaultValueSql("getutcdate()") ; }