Exemplo n.º 1
0
 /// <summary>
 /// Add UploadQueue service to NextApi
 /// </summary>
 /// <param name="serverBuilder"></param>
 /// <param name="serviceName"></param>
 /// <param name="uploadQueueModelsAssemblyName"></param>
 /// <returns></returns>
 public static NextApiServiceBuilder AddUploadQueueService(this NextApiBuilder serverBuilder,
                                                           string uploadQueueModelsAssemblyName, string serviceName = null)
 {
     serverBuilder.ServiceCollection.AddTransient(c =>
                                                  new UploadQueueService(
                                                      c.GetService <IColumnChangesLogger>(),
                                                      c.GetService <IUnitOfWork>(), c,
                                                      uploadQueueModelsAssemblyName));
     return(serverBuilder.AddService <UploadQueueService>(serviceName, false));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Add default NextApi entity service for tree-type entity type
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="serviceName">Service name (optional, by default is it entity name)</param>
 /// <typeparam name="TEntityDto">DTO type for entity</typeparam>
 /// <typeparam name="TEntity">Entity type</typeparam>
 /// <typeparam name="TKey">Entity key type</typeparam>
 /// <typeparam name="TParentKey">Parent entity key</typeparam>
 /// <returns>Service builder for detailed configuration</returns>
 public static NextApiServiceBuilder AddTreeEntityService <TEntityDto,
                                                           TEntity, TKey, TParentKey>(this NextApiBuilder builder,
                                                                                      string serviceName = null)
     where TEntityDto : class, ITreeEntityDto <TKey, TParentKey>
     where TEntity : class, ITreeEntity <TKey, TParentKey>
 {
     if (string.IsNullOrWhiteSpace(serviceName))
     {
         serviceName = typeof(TEntity).Name;
     }
     return(builder.AddService <NextApiTreeEntityService <TEntityDto, TEntity, TKey, TParentKey> >(serviceName));
 }