public async Task <LocalizationContentResult> CreateLocalizationContent(ILocalizableContent <T, TContentType> input, bool overwrite, int?tenantId = null) { var cont = AbpCinotamLocalizableContent.CreateLocalizableContent(input); var languageInDb = _localizationContentStore.LocalizableContents.FirstOrDefault( a => a.Lang == input.Lang && a.EntityDtoName == input.EntityDtoName && a.EntityName == input.EntityName && a.EntityId == input.EntityId); if (languageInDb != null && !overwrite) { return(LocalizationContentResult.ContentExists); } if (overwrite && languageInDb != null) { languageInDb.Properties = cont.Properties; await _localizationContentStore.SaveContent(languageInDb, tenantId); return(LocalizationContentResult.ContentUpdated); } var id = await _localizationContentStore.SaveContent(cont, tenantId); return(id != 0 ? LocalizationContentResult.Success : LocalizationContentResult.Error); }
public static AbpCinotamLocalizableContent CreateLocalizableContent <T, TContentType> (ILocalizableContent <T, TContentType> input) where T : class where TContentType : class { return(new AbpCinotamLocalizableContent() { EntityName = input.EntityName, Lang = input.Lang, EntityId = input.EntityId, Properties = input.Properties, EntityDtoName = input.EntityDtoName }); }