Hello, I am confused about debugging the ABP project which I have downloaded from the Github(https://github.com/aspnetboilerplate/aspnetboilerplate).Thank a lot
whatever the JsonResult I write , I found abp my application always return success, result, error, xxxx, and 'result' contained the value I wanted to return.How could I use my return value !!!!!!I'm in a hurry………………
I found I can't inject “ILogger” as usual, there is no inject point in actionfilter, can you help me to solve it out
<cite>hikalkan: </cite> Using IocManager .Instance.Resolve is a good way. But I suggest ResolveAsDisposable method since you should always release a class if you resolved it manually.
Another way: You can register filter attribute to dependency injection and register your filter like that: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.Web.Api/WebApi/AbpWebApiModule.cs#L82">https://github.com/aspnetboilerplate/as ... ule.cs#L82</a>
Thanks a lot! Actually,I found some other questions in using abp's Context.set<TEntity>().Methods Like AddRange and so on . Sometimes,yes,sometimes, there are no reactions.No successful ,no fail tips even thouth I used 'Try Catch' to grab the ex. And sometimes it works. There is my code. Could I get help from you? public async Task< OperationResult> ImportSchoolList(List<AbpSchool> schoolList) { var operatioResult = new OperationResult();
try
{
Context.Set<AbpSchool>().AddRange(schoolList);
operatioResult.AppendData = await Context.SaveChangesAsync();
}
catch (Exception ex)
{
LoggerHelper.Error(ex.Message, ex);
}
return operatioResult;
}
Hi.I have to admit that I spent a lot of time to write these words(sorry,my English is poor) In the ActionFilter of Mvc, I can't use constructor or property Injection, cuz there are no injection points. Finally, I choose the method which can work. When I defined a interface such as ITest which contain the method like 'GetName()', and I defined the Test which inherited the former. I write the code like 'IocManager.IocContainer.Register( Component.For<ITest >());' in the 'Initialize' of Module's methods. And I resolve the ITest in my action filter like 'var test = IocManager .Instance.Resolve< ITestService >().GetName();', Yes, it can work.But I want to know, how do you deal with it when you want to use the services' methods or some interface by injected!!! thanks a lot.!!!
<cite>hikalkan: </cite> Because, AddRange is defined in DbSet, not in IDbSet. You've two options:
- Just use Table as shown below:
var data = Table.AddRange(tasks);
- Use DbSet instead of IDbSet in your DbContext properties.
Thanks a lot!
When I create an repository like 'Repository', I can't use those methods such as 'AddRange' or others. Here is my code
public class TaskRepository: BrightEyesProjectRepositoryBase<Task,long>, ITaskRepository { public TaskRepository(IDbContextProvider<BrightEyesProjectDbContext> dbContextProvider) : base(dbContextProvider) { }
public OperationResult InsertTaskList(List<Task> tasks)
{
var operationResult = new OperationResult(OperationResultType.Success);
**var data = Context.Tasks.AddRange(tasks);**// there is a mistake about 'AddRange'.IDbSet<Task> Not included in the definition of 'AddRange'.
throw new NotImplementedException();
}
}
Could you fix it, thank you...