예제 #1
0
        public virtual ApiFileTypeServerResponseModel MapServerRequestToResponse(
            int id,
            ApiFileTypeServerRequestModel request)
        {
            var response = new ApiFileTypeServerResponseModel();

            response.SetProperties(id,
                                   request.Name);
            return(response);
        }
예제 #2
0
        public virtual ApiFileTypeServerResponseModel MapEntityToModel(
            FileType item)
        {
            var model = new ApiFileTypeServerResponseModel();

            model.SetProperties(item.Id,
                                item.Name);

            return(model);
        }
예제 #3
0
        public virtual ApiFileServerResponseModel MapEntityToModel(
            File item)
        {
            var model = new ApiFileServerResponseModel();

            model.SetProperties(item.Id,
                                item.BucketId,
                                item.DateCreated,
                                item.Description,
                                item.Expiration,
                                item.Extension,
                                item.ExternalId,
                                item.FileSizeInByte,
                                item.FileTypeId,
                                item.Location,
                                item.PrivateKey,
                                item.PublicKey);
            if (item.BucketIdNavigation != null)
            {
                var bucketIdModel = new ApiBucketServerResponseModel();
                bucketIdModel.SetProperties(
                    item.BucketIdNavigation.Id,
                    item.BucketIdNavigation.ExternalId,
                    item.BucketIdNavigation.Name);

                model.SetBucketIdNavigation(bucketIdModel);
            }

            if (item.FileTypeIdNavigation != null)
            {
                var fileTypeIdModel = new ApiFileTypeServerResponseModel();
                fileTypeIdModel.SetProperties(
                    item.FileTypeIdNavigation.Id,
                    item.FileTypeIdNavigation.Name);

                model.SetFileTypeIdNavigation(fileTypeIdModel);
            }

            return(model);
        }