Skip to content
Thang Chung edited this page Jul 13, 2019 · 15 revisions

Brainstorm

New name for AdminLTE on Blazor should be BladminLTE

Sample projects

Reactive snippet

public IObservable<dynamic> GetVideoGridForDisplay(int userId)
{
    return GetListOfLists(userId).SelectMany(list =>
    {
        return list.Videos()
            .Take(10)
            .SelectMany(video =>
            {
                var m = video.Metadata().Select(md => new { title = md["title"], length = md["duration"] });
                var b = video.Bookmark(userId).Select(bookmark => bookmark);
                var r = video.Rating(userId).Select(rating => new
                {
                    actual = rating.ActualStarRating(),
                    average = rating.AverageStarRating(),
                    predicted = rating.PredictedStarRating()
                });

                return Observable.Zip(m, b, r, (metadata, bookmark, rating) =>
                {
                    return new
                    {
                        id = video.VideoId,
                        metadata.title,
                        metadata.length,
                        bookmark,
                        rating
                    };
                });
            });
    });
}
// https://dzone.com/articles/5-things-to-know-about-reactive-programming
manager.getCampaignById(id)
  .flatMap(campaign ->
    manager.getCartsForCampaign(campaign)
      .flatMap(list -> {
        Single<List<Product>> products = manager.getProducts(campaign);
        Single<List<UserCommand>> carts = manager.getCarts(campaign);
        return products.zipWith(carts, 
            (p, c) -> new CampaignModel(campaign, p, c));
      })
     .flatMap(model -> template
        .rxRender(rc, "templates/fruits/campaign.thl.html")
        .map(Buffer::toString))
    )
    .subscribe(
      content -> rc.response().end(content),
     err -> {
      log.error("Unable to render campaign view", err);
      getAllCampaigns(rc);
    }
);
  • List of functions for Repository at here
    public interface IRepository<TEntity> : IDisposable
            where TEntity : class        
    {
        bool IsDisposed { get; }
    
        TEntity Find(params object[] keyValues);

        TEntity Find(Expression<Func<TEntity, bool>> filter, 
                     Expression<Func<TEntity, object>>[] include = null);
    
        Task<TEntity> FindAsync(Expression<Func<TEntity, bool>> filter,
                                Expression<Func<TEntity, object>>[] include = null);
    
        IQueryable<TEntity> Query(Expression<Func<TEntity, object>>[] include = null);
    
        TEntity Create();
    
        TEntity Create(TEntity value);        
    
        bool Update(TEntity value);
    
        void Delete(TEntity value);
    
        void Delete(IEnumerable<TEntity>entities);
    
        void Reset(TEntity value);
    
        Task ResetAsync(TEntity value);
      
    }
  • Add version for the Assembly
// reference at https://github.com/GaProgMan/dwCheckApi/blob/master/dwCheckApi/Controllers/VersionController.cs
Assembly.GetEntryAssembly()
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
.InformationalVersion;

Sample requirements

Deployment

Testing

Clean Architecture overview

Clone this wiki locally