thank you
thank you very much for your advice :D
can you please explain the problem and solution in more details because i have the same problem so when i need to send email i use simple email method
no its inside RoleAppService.cs in GetRoleForEdit Method
var blockedPermissionsAppService = new BlockedPermissionsAppService(new BlockedPermissionsRepository());
var lst = blockedPermissionsAppService.GetList();
var permissions = PermissionManager.GetAllPermissions().Where(w => lst.All(a => a.Name != w.Name));
Hello Oliver please note that by default sending emails are disabled in debug mode
you can enable it yourself , you can find code repsponsible for that in ProjectCore Solution at ProjectCoreModule.cs
if (DebugHelper.IsDebug)
{
//Disabling email sending in debug mode
IocManager.Register<IEmailSender, NullEmailSender>(DependencyLifeStyle.Transient);
}
hope that help , good luck
thank you very much for your advice .. actually i admire you and impressed with amount of perfect work done in aspnetzero and really enjoy using it and looking for more from you
back again to my question .. i need to learn more so consider that i need to use my code above to retrieve data from database , how can i accomplish that using dependency injection , can you correct my mistakes and write the write code to learn the proper way :)
actually the both
hi , i appreciate your concern .. but as you know i have problem with mastering the structure of the dependency injection , so i wondering of you have time to provide me with code that help in my case
thank you
Hello before i wrote this topic i read the documentation related to Dependency Injection [http://www.aspnetboilerplate.com/Pages/Documents/Dependency-Injection]) and other related documentation [http://www.aspnetboilerplate.com/Pages/Documents/Repositories])
but i'm still need help and advice in my case , maybe for some of you my questions are naive , for other are easy , on the other hand for someone like me its confused and need answers to put things together and make the big picture clear as possible as we can
so i have a class that have one of more properties used to retrieve static data (not coming from database) , i tried to use dependency injection structure descried in the documentation but still have doubts that what's i'm doing is not totally true Q1- can anyone correct me if i'm wrong with what i done here? Q2- can you provide me with different ways (practical examples) to accomplish my task based on my code below and please don't refer me to external links :) ? Q3- what is the write place to put these classes in my project ?
Classes & Interfaces
1- BlockedPermissions.cs
public class BlockedPermissions
{
public string Name { get; set; }
}
2-IBlockedPermissionsAppService.cs (never used in my code)
public interface IBlockedPermissionsAppService : IApplicationService
{
List<BlockedPermissions> GetList();
}
3- BlockedPermissionsAppService.cs
public class BlockedPermissionsAppService
{
private IBlockedPermissionsRepository _blockedPermissionsRepository;
public BlockedPermissionsAppService(IBlockedPermissionsRepository blockedPermissionsRepository)
{
_blockedPermissionsRepository = blockedPermissionsRepository;
}
public List<BlockedPermissions> GetList()
{
var lst = _blockedPermissionsRepository.GetList();
return lst;
}
}
4- IBlockedPermissionsRepository.cs
public interface IBlockedPermissionsRepository
{
List<BlockedPermissions> GetList();
}
5- BlockedPermissionsRepository.cs
public class BlockedPermissionsRepository : IBlockedPermissionsRepository
{
public List<BlockedPermissions> GetList()
{
List<BlockedPermissions> lst = new List<BlockedPermissions>();
lst.Add(new BlockedPermissions() { Name = "Pages.Administration.Languages" });
lst.Add(new BlockedPermissions() { Name = "Pages.Administration.Languages.Create" });
lst.Add(new BlockedPermissions() { Name = "Pages.Administration.Languages.Edit" });
lst.Add(new BlockedPermissions() { Name = "Pages.Administration.Languages.Delete" });
return lst;
}
Finally i use this code to retrieve the list
var blockedPermissionsAppService = new BlockedPermissionsAppService(new BlockedPermissionsRepository());
var lst = blockedPermissionsAppService.GetList();
Sorry to prolong and thank you :)
Hello i'm trying to get current authenticated user's information using this code
var r = new SessionAppService().GetCurrentLoginInformations(); string userName = r.Result.User.UserName;
but it's not work as r.Result always null
is that the right piece of code to accomplish this task?