Skip to content

Instantly share code, notes, and snippets.

View ebicoglu's full-sized avatar
:octocat:
Full stack developer

Alper Ebiçoğlu ebicoglu

:octocat:
Full stack developer
View GitHub Profile
@ebicoglu
ebicoglu / AbpAjaxResponse
Created August 23, 2017 06:49
Logining to AspNet Zero Website and get Access Token for api request via RestSharp
public class AjaxResponse<TResult> : AjaxResponseBase
{
/// <summary>
/// The actual result object of AJAX request.
/// It is set if <see cref="AjaxResponseBase.Success"/> is true.
/// </summary>
public TResult Result { get; set; }
/// <summary>
/// Creates an <see cref="AjaxResponse"/> object with <see cref="Result"/> specified.
@ebicoglu
ebicoglu / TenantAppService.cs
Last active April 17, 2018 07:19
[AspNet Zero] Drop tenant database when a tenant is deleted (for db for tenant usage)
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Abp;
using Abp.Application.Features;
using Abp.Application.Services.Dto;
using Abp.Authorization;
using Abp.Authorization.Users;
using Abp.Data;
@ebicoglu
ebicoglu / AbpDynamicSettingService.cs
Last active May 9, 2018 06:10
Aspnet Boilerplate Dynamic Setting Service via repository
using System.Linq;
using Abp.Collections.Extensions;
using Abp.Configuration;
using Abp.Dependency;
using Abp.Domain.Repositories;
using Abp.Domain.Uow;
namespace MyCompanyName.AbpZeroTemplate.MySettingService
{
public class DynamicSettingService : ITransientDependency
@ebicoglu
ebicoglu / TSQL-to-C#-POCO-Generator
Last active April 21, 2024 09:28
Generates C# POCO classes from a SQL Server Database. Run this query against the database and the script will loop through tables, views and generate all entities.
/* USAGE:
Run this query against the database
The script will loop through tables, views and generate all entities.
*/
DECLARE @CONFIG_SHOULD_CONVERT_TO_SINGULAR_TABLE_NAME BIT = 1;
DECLARE @tableName varchar(200)
DECLARE @columnName varchar(200)
DECLARE @nullable varchar(50)
I made a super cool extension method that returns whether the selection is included in a GraphQL query.
---
## Extension Method
using System;
using System.Linq;
using GraphQL.Language.AST;
using GraphQL.Types;

To customize the UI,

You can replace the current view with a new one. This is a customized account view: Create a file named Default.cshtml and put it in the folder Acme.BookStore\src\Acme.BookStore.Web\Themes\Lepton\Layouts\Account

@using System.Globalization
@using Microsoft.Extensions.Localization
@using Microsoft.Extensions.Options
@using Volo.Abp.AspNetCore.MultiTenancy
@ebicoglu
ebicoglu / Customize-abp-login-page.md
Last active March 25, 2020 07:22
Override account/default.cshtml

How to customize the UI of ABP Commercial MVC project

I'll make an example with the Acme.BookStore project and modify the login page of the ABP Commercial MVC template.

To replace a view/CSS with a new one, rename your new file as the original one and put it in the same directory with the original directory path.

For this example, I'll overwrite Account/Login page. Below is the content of my customized login view. Create a file named Default.cshtml and put it in the folder *Acme.BookStore\src\Acme.BookStore.Web\Themes\Lepton\Layouts\Account*

SET ASPNETCORE_ENVIRONMENT=Development
SET LAUNCHER_PATH=bin\Debug\netcoreapp3.1\Volo.AbpIo.Account.Web.exe
cd /d "C:\Program Files\IIS Express\"
iisexpress.exe /config:"D:\Github\volo\abp\abp_io\.vs\Volo.AbpIo\config\applicationhost.config" /site:"Volo.AbpIo.Account.Web" /apppool:"Volo.AbpIo.Account.Web AppPool
@ebicoglu
ebicoglu / passwordless-token-provider.md
Last active March 24, 2024 15:12
Implementing Passwordless Authentication in ASP NET Core Identity

Implementing Passwordless Authentication in ASP.NET Core Identity

To allow a user login with a magic URL, you need to implement a custom token provider. I'll show you how to add a custom token provider to authenticate a user with a link.

Step-1

Create a class named PasswordlessLoginProvider in your *.Web project.

PasswordlessLoginProvider.cs

  1. Open Acme.BookStore.IdentityServer.csproj project and add the below package reference:
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0" />

  1. Add the below code into ConfigureServices() method of BookStoreIdentityServerModule.cs