Beispiel #1
0
        public Object Map(CreateOrEditViewModel createOrEdit)
        {
            Object @object = new Object();

            if (createOrEdit.Id != null)
            {
                @object = this.RequestHandler.Storage.GetRepository <IObjectRepository>().WithKey((int)createOrEdit.Id);
            }

            else
            {
                @object.ClassId = (int)createOrEdit.ClassId;
            }

            @object.ViewName = createOrEdit.ViewName;

            Class @class = this.RequestHandler.Storage.GetRepository <IClassRepository>().WithKey(@object.ClassId);

            if (@class.IsStandalone == true)
            {
                @object.Url = createOrEdit._Url;
            }

            else
            {
                @object.Url = null;
            }

            return(@object);
        }
        public Object Map(CreateOrEditViewModel createOrEdit)
        {
            Object @object = new Object();

            if (createOrEdit.Id != null)
            {
                @object = this.RequestHandler.Storage.GetRepository <IObjectRepository>().WithKey((int)createOrEdit.Id);
            }

            else
            {
                @object.ClassId = (int)createOrEdit.ClassId;
            }

            return(@object);
        }