Beispiel #1
0
 public static DT.ValueName ToDto(DA.ValueName source)
 {
     if (source == null)
     {
         return(null);
     }
     return(new DT.ValueName()
     {
         Id = source.Id, Category = source.Category, Name = source.Name
     });
 }
        private static DA.ValueName ToEntity(string name, DA.ValueNameCategory category, DA.ValueNameType type, DA.OKBDataContext okb)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }
            var entity = okb.ValueNames.FirstOrDefault(x => (x.Name == name) && (x.Category == category) && (x.Type == type));

            if (entity == null)
            {
                entity = new DA.ValueName()
                {
                    Id = 0, Name = name, Category = category, Type = type
                }
            }
            ;
            return(entity);
        }
Beispiel #3
0
 private static DA.ValueName ToEntity(string name, DA.ValueNameCategory category, DA.ValueNameType type, DA.OKBDataContext okb) {
   if (string.IsNullOrEmpty(name)) return null;
   var entity = okb.ValueNames.Where(x => (x.Name == name) && (x.Category == category) && (x.Type == type)).FirstOrDefault();
   if (entity == null)
     entity = new DA.ValueName() { Id = 0, Name = name, Category = category, Type = type };
   return entity;
 }
 partial void DeleteValueName(ValueName instance);
 partial void UpdateValueName(ValueName instance);
 partial void InsertValueName(ValueName instance);