Пример #1
0
        public IPagedResponse <AssetModel> GetAssets([FromUri] PagingFilter filter)
        {
            if (filter == null)
            {
                filter = new PagingFilter(1, 25);
            }

            IPagedResponse <IAsset> results = Asset.GetAssets(filter.Page, filter.Size);

            ICollection <AssetModel> assets = new List <AssetModel>();

            if (results.Data != null)
            {
                foreach (IAsset a in results.Data)
                {
                    var asset = AssetModel.Load(a);
                    assets.Add(asset);
                }
            }

            return(new PagedResponse <AssetModel>()
            {
                TotalCount = results.TotalCount,
                Data = assets
            });
        }
Пример #2
0
        public AssetModel GetAssetById(int id)
        {
            IAsset result = Asset.GetAssetById(id);
            var    asset  = AssetModel.Load(result);

            return(asset);
        }
Пример #3
0
 public void Load(Action onLoaded)
 {
     model = AssetModelFactory.CreateModel(AssetType.UI_PANEL, res);
     model.Load(OnLoaded + onLoaded);
 }