Base solution for your next web application

Activities of "epayday"

Question

I found this support post https://support.aspnetzero.com/QA/Questions/3591 with regards to Seeding Tenant Data.

Got the code working but I am confused on how I can seed the data with the correct Tenant ID.

var defaultTenant = _context.Tenants.IgnoreQueryFilters().FirstOrDefault(t => t.TenancyName == MultiTenancy.Tenant.DefaultTenantName);

The above line of code gives me the default ID of 1.

I know elsewhere you get the current tenant via AbpSession.TenantId but due to my limited knowledge I can't work out how access ApbSession inside my custom code called from DefaultTenantBuilder.cs

Hi, we want to use a copy of the _CreateXxxxxModal.cshtml as an _EditXxxxxModal.cshtml. We will need to populate the modal as it opens with the row data for the row that was selected Id. Allow change s and if the save button is pressed update the data in that row of the database table for that Id.

We are not sure where to start and are concerned of taking the wrong direction causing further delays. Do we start by going to the AppService file and adding an Async function? Not sure how we get the Modal to populate.

Do we use

FindAsync InsertAsync

UpdateAsync

?????????

    //[AbpAuthorize(AppPermissions.Pages_Tenant_PayRate_Edit)]
    //public async Task EditPayRate(EntityDto input)
    //{
    //    var payRate = input.PayRateID;
    //    var payRatedetails = _payRateRepository
    //                        .GetAll()
    //                        .WhereIf(!(payRate.Equals(0)),
    //                                   p => p.PayRateID.Equals(payRate)).ToList();

    //    if (payRatedetails.Count > 0)
    //    {
    //        var entity = await _payRateRepository
    //                                .EpdPayRate
    //                                .FindAsync(entity => entity.SomeId == matchingId);

    //        entity.PropertyA = "something";
    //        entity.PropertyB = 1;
    //        await _payRateRepository.SaveChangesAsync();
    //    }
    //    else
    //    {
    //        var payRateinfo = input.MapTo<PayRate>();
    //        await _payRateRepository.InsertAsync(payRate);
    //    }
    //}

Thanks, e-PayDay.

Question

Hi, we have just started looking at testing our project on Azure. I notice our .Application and .Core folders have their publish buttons grayed out. A procedure of moving the project components as well as the SQL database to Azure and any warning of pitfalls would be appreciated.

Thanks, :D

Question

Hi, I am trying to replicate part of the tutorial PhoneBook in regards to displaying the contents on a page of another table in the database, PayRateType table. In my PayRateTypeAppService class I have the following line of code.

return new ListResultDto<PayRateTypeListDto>(PayRateType.MapTo<List<PayRateTypeListDto>>());

For this line of code I get the following error. Error CS0117 'PayRateType' does not contain a definition for 'MapTo" The equivalent Person class does not appear to contain a definition for "MapTo" either, however this does not create an error? I think there is something going on behind the scene, but I am not sure how / why it works for the phonebook example and not for ours. Thanks,

Question

Hi, for v2.1 we replaced IdInput with EntityDto. However there is still one error remaining as to attachement. Code below [AbpAuthorize(AppPermissions.Pages_Tenant_PhoneBook_DeletePerson)] public async Task DeletePerson(EntityDto input) { await _personRepository.DeleteAsync(input.Id); } Cannot convert from method group to person. Thanks, [attachment=0:3mwr7p2q]Delete Person 17102016 1028.png[/attachment:3mwr7p2q]

Question

Hi, we have downloaded the ASP.NETZero V2.1 and we have attempted to go through the PhoneBook tutorial. We got up to the creating person application service section. ListResultOutput CS0246 - Show potential fixes > Generate class ListResultOutput.

public ListResultOutput<PersonListDto> GetPeople(GetPeopleInput input) { var persons = _personRepository .GetAll() .WhereIf( !input.Filter.IsNullOrEmpty(), p => p.Name.Contains(input.Filter) || p.Surname.Contains(input.Filter) || p.EmailAddress.Contains(input.Filter) ) .OrderBy(p => p.Name) .ThenBy(p => p.Surname) .ToList();

        return new ListResultOutput&lt;PersonListDto&gt;(persons.MapTo&lt;List&lt;PersonListDto&gt;>());
    }

I think the return may be causing the issues? Also, public class PersonAppService : epaydayServiceBase, IPersonAppService CS0738 - Show potential fixes > Implement interface.

I am guessing others are using V2.1. Have other people come across these issues and know why they arise with V2.1?

Thanks,

Showing 1 to 6 of 6 entries