C#和数据库属性之间的连接

时间:2017-07-21 18:10:06

标签: c# database-connection

我想知道,如果在发布和发布项目之前我的应用程序是否容易受到攻击,有人会看到下面的代码吗?

有任何建议,最好还是这样或有更好的方法吗?

namespace ACCDataStore.Entity.Mapping
{
    public class UserMap : BaseEntityMap<User>
    {
        public UserMap()
        {
            Map(x => x.ID);
            Map(x => x.Password);
            Map(x => x.Fullname);            
            Map(x => x.Organization);
            Map(x => x.Occupation);
            Map(x => x.Gender);
            Map(x => x.Password1);
            Map(x => x.Email);
            Map(x => x.EmailConfirmed);
            Map(x => x.Token);
            Map(x => x.TokenExpired);
            Map(x => x.TokenStart);
         }
    }

    public class User : BaseEntity
    {
        public virtual string Password { get; set; }
        public virtual string Fullname { get; set; }
        public virtual string Email { get; set; }
        public virtual string Token { get; set; }
        public virtual string TokenStart { get; set; }
        public virtual bool TokenExpired { get; set; }
        public virtual bool EmailConfirmed { get; set; }
        public virtual string Organization { get; set; }
        public virtual string Occupation { get; set; }
        public virtual string Gender { get; set; }
        public virtual string Password1 { get; set; }
        public virtual bool Enable { get; set; }
        public virtual bool IsAdministrator { get; set; }

        public virtual object GetJson()
        {
            return new
            {
                ID = this.ID,
                Password = this.Password,
                Fullname = this.Fullname,
                Email = this.Email,
                Token = this.Token,
                TokenStart = this.TokenStart,
                TokenExpired = this.TokenExpired,
                EmailConfirmed = this.EmailConfirmed,
                Organization = this.Organization,
                Occupation = this.Occupation,
                Gender = this.Gender,
                Password1 = this.Password1,
                Enable = this.Enable,
            };
        }
    }
}

0 个答案:

没有答案