Пример #1
0
        public static AdapterSettings CreateSingle(string adapterName)
        {
            var entity = new AdapterSettings
                {
                    AdapterName = adapterName,
                    OAuthAccessToken = OAuthAccessTokenCreator.CreateSingle(),
                    OAuthRequestToken = OAuthRequestTokenCreator.CreateSingle()
                };

            entity.SetName = string.Format(CultureInfo.InvariantCulture, "SetName {0}", entity.Id);

            return entity;
        }
        public VideoAdapterSettingsDetailsModel MapToDetail(AdapterSettings entity)
        {
            var model = new VideoAdapterSettingsDetailsModel
                       {
                           Id = entity.Id,
                           CreationDate = entity.CreationDate,
                           ModificationDate = entity.ModificationDate,

                           SetName = entity.SetName,
                       };

            var oAuthAccesToken = entity.OAuthAccessToken;
            if (oAuthAccesToken == null) return model;

            model.FullName = oAuthAccesToken.FullName;
            model.UserId = oAuthAccesToken.UserId;
            model.UserName = oAuthAccesToken.Username;

            return model;
        }
Пример #3
0
 public AdapterSettings AddAdapterSettings(AdapterSettings settings)
 {
     return _catalogsContainer.BandCatalog.Add(settings);
 }
Пример #4
0
 public AdapterSettings UpdateAdapterSettings(AdapterSettings settings)
 {
     return _catalogsContainer.BandCatalog.Update(settings);
 }
Пример #5
0
        public AdapterSettings UpdateAdapterSettings(AdapterSettings settings)
        {
            if (settings == null) throw new ArgumentNullException("settings");

            return BandRepository.UpdateAdapterSettings(settings);
        }
        public UpdateVideoAdapterSettingsModel MapToUpdate(AdapterSettings entity)
        {
            var model = new UpdateVideoAdapterSettingsModel
                       {
                           SetName = entity.SetName,
                       };

            var oAuthAccesToken = entity.OAuthAccessToken;
            if (oAuthAccesToken == null) return model;

            model.FullName = oAuthAccesToken.FullName;
            model.UserId = oAuthAccesToken.UserId;
            model.UserName = oAuthAccesToken.Username;

            return model;
        }