Beispiel #1
0
        public SysInfo AddSysInfo(SysInfo sysInfo)
        {
            SysInfoEntity entity = sysInfo.ToEntity();

            this.dbContext.SysInfos.Add(entity);
            this.dbContext.SaveChanges();
            return(entity.ToModel());
        }
Beispiel #2
0
        public SysInfo GetSysInfoByName(string name)
        {
            SysInfoEntity entity = this.dbContext.SysInfos.FirstOrDefault(si => si.Name == name);

            return(entity == null ? null : entity.ToModel());
        }
Beispiel #3
0
        public SysInfo GetSysInfoById(int id)
        {
            SysInfoEntity entity = this.dbContext.SysInfos.FirstOrDefault(si => si.Id == id);

            return(entity == null ? null : entity.ToModel());
        }