public Tab Map(CreateOrEditViewModel createOrEdit)
        {
            Tab tab = new Tab();

              if (createOrEdit.Id != null)
            tab = this.handler.Storage.GetRepository<ITabRepository>().WithKey((int)createOrEdit.Id);

              else tab.ClassId = createOrEdit.ClassId;

              tab.Name = createOrEdit.Name;
              tab.Position = createOrEdit.Position;
              return tab;
        }
Пример #2
0
        public Tab Map(CreateOrEditViewModel createOrEdit)
        {
            Tab tab = new Tab();

            if (createOrEdit.Id != null)
            {
                tab = this.handler.Storage.GetRepository <ITabRepository>().WithKey((int)createOrEdit.Id);
            }

            else
            {
                tab.ClassId = createOrEdit.ClassId;
            }

            tab.Name     = createOrEdit.Name;
            tab.Position = createOrEdit.Position;
            return(tab);
        }