Skip to content

Instantly share code, notes, and snippets.

View KristianMariyanov's full-sized avatar

Kristian Mariyanov KristianMariyanov

View GitHub Profile
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Claims;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using LaptopListingSystem.Web.Authentication;
using LaptopListingSystem.Web.Data;
public static readonly ILoggerFactory MyLoggerFactory = LoggerFactory.Create(builder => { builder.AddDebug(); });
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<WeatherForecastContext>(options =>
options.UseLoggerFactory(MyLoggerFactory)
.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")), ServiceLifetime.Transient);
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddScoped<WeatherForecastService>();
<TelerikGrid Data=@GridData
Height=@Height
Sortable=true
Pageable=true>
<GridColumns>
<GridColumn Field=@nameof(Product.ProductId) Sortable="false" Title="Id" />
<GridColumn Field=@nameof(Product.ProductName) Title="Product Name" />
<GridColumn Field=@nameof(Product.UnitPrice) Title="Unit Price">
<Template>
@(String.Format("{0:C2}", (context as Product).UnitPrice))