Advertisement
LYSoft

Untitled

May 12th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. // The type 'Ortund.Web.Objects.User' cannot be used as type parameter 'T' in the generic type or method 'Ortund.DBBase.OrtundDBBaseObject<T>'. There is no implicit reference conversion from 'Ortund.Web.Objects.User' to 'Ortund.Base.OrtundBaseObject`1<Ortund.Web.Objects.User>'.
  2.  
  3.  
  4.     // inherits Ortund.DBBase.OrtundDBBaseObject<Ortund.Web.Objects.User>
  5.     public class UserDBContext : OrtundDBBaseObject<User>
  6.     {
  7.         public UserDBContext()
  8.             : base()
  9.         {
  10.             Property(p => p.Username)
  11.                 .HasColumnName("sUsername")
  12.                 .HasMaxLength(20)
  13.                 .IsRequired();
  14.  
  15.             Property(p => p.EmailAddress)
  16.                 .HasColumnName("sEmailAddress")
  17.                 .HasMaxLength(200)
  18.                 .IsRequired();
  19.  
  20.             Property(p => p.Password)
  21.                 .HasColumnName("sPassword")
  22.                 .HasMaxLength(10)
  23.                 .IsRequired();
  24.  
  25.             Property(p => p.Biography)
  26.                 .HasColumnName("sBiography")
  27.                 .HasColumnType("text");
  28.  
  29.             ToTable("Users");
  30.  
  31.         }
  32.     }
  33.  
  34.     public abstract class OrtundDBBaseObject<T> : EntityTypeConfiguration<T>
  35.         where T : OrtundBaseObject<T>
  36.     {
  37.  
  38.         public OrtundDBBaseObject()
  39.             : base()
  40.         {
  41.             HasKey(p => p.PKey);
  42.         }
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement