Hello Developers Community,
Here I'm introducing a new list of Visual Studio Snippets which will help you to create all basic methods of Admin Controllers, Model Factories and Services within seconds. You can also write all basic declarations of Interfaces in moments.

Download from here.

How to integrate:
1. Download the .snippet file from given link.
2. Open Visual Studio.
3. Click Tools >> Code Snippets Manager.
4. Click Import....
5. Select the snippet file.


How to use:
For example, type narm (Nop Action Result Methods) and then press Tab twice, and all these will create below codes.

#region Fields

private readonly ILocalizationService _localizationService;
private readonly INotificationService _notificationService;
private readonly ICustomModelFactory _customModelFactory;
private readonly ICustomService _customService;

#endregion

#region Ctor

public CustomController(ILocalizationService localizationService,
    INotificationService notificationService,
  ICustomModelFactory customModelFactory,
  ICustomService customService)
{
    _localizationService = localizationService;
    _notificationService = notificationService;
  _customModelFactory = customModelFactory;
  _customService = customService;
}

#endregion

#region Methods        

public virtual IActionResult Index()
{
    return RedirectToAction("List");
}

public virtual IActionResult List()
{
  var searchModel = _customModelFactory.PrepareCustomSearchModel(new CustomSearchModel());
    return View(searchModel);
}

public virtual IActionResult GetList(CustomSearchModel searchModel)
{
  var model = _customModelFactory.PrepareCustomListModel(searchModel);
    return Json(model);
}

public virtual IActionResult Create()
{
    var model = _customModelFactory.PrepareCustomModel(new CustomModel(), null);
    return View(model);
}

[HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")]
public virtual IActionResult Create(CustomModel model, bool continueEditing)
{
    if (ModelState.IsValid)
    {
    var custom = new Custom();
    _customService.InsertCustom(custom);
        
        _notificationService.SuccessNotification(_localizationService.GetResource("Admin.Custom.Created"));

        if (!continueEditing)
            return RedirectToAction("List");

        return RedirectToAction("Edit", new { id = custom.Id });
    }
      
  model = _customModelFactory.PrepareCustomModel(new CustomModel(), null);
            
  return View(model);
}

public virtual IActionResult Edit(int id)
{
  var custom = _customService.GetCustomById(id);
  if(custom == null)
    throw new ArgumentNullException(nameof(custom));
      
  var model = _customModelFactory.PrepareCustomModel(null, custom);
      
    return View(model);
}

[HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")]
public virtual IActionResult Edit(CustomModel model, bool continueEditing)
{
  var custom = _customService.GetCustomById(model.Id);
  if(custom == null)
    throw new ArgumentNullException(nameof(custom));
      
    if (ModelState.IsValid)
    {
    _customService.UpdateCustom(custom);
        _notificationService.SuccessNotification(_localizationService.GetResource("Admin.Custom.Updated"));

        if (!continueEditing)
            return RedirectToAction("List");

        return RedirectToAction("Edit", new { id = custom.Id });
    }
  model = _customModelFactory.PrepareCustomModel(model, custom);
    return View(model);
}

[HttpPost]
public virtual IActionResult Delete(int id)
{
  var custom = _customService.GetCustomById(id);
  if(custom == null)
    throw new ArgumentNullException(nameof(custom));
      
  _customService.DeleteCustom(custom);
        
    _notificationService.SuccessNotification(_localizationService.GetResource("Admin.Custom.Deleted"));

    return RedirectToAction("List");
}

#endregion


Here Custom and custom texts will be highlighted. When you replace any one of them with a Entity name, all highlighted text will be replaced.