Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "wddpct"

<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&lt;AbpSchool&gt;().AddRange(schoolList);

            operatioResult.AppendData = await Context.SaveChangesAsync();
        }
        catch (Exception ex)
        {

            LoggerHelper.Error(ex.Message, ex);
        }
        
        return operatioResult;
    }

<cite>hikalkan: </cite> Because, AddRange is defined in DbSet, not in IDbSet. You've two options:

  1. Just use Table as shown below:

var data = Table.AddRange(tasks);

  1. Use DbSet instead of IDbSet in your DbContext properties.

Thanks a lot!

Showing 1 to 2 of 2 entries