I find it out. Thank You
Hi
I too have the same problem. But i used Abp.Linq.Extensions and im getting error as There is no argument given that corresponds to the required formal parameter 'value' of 'string.IsNullOrEmpty(string)'
My code is using Abp.Application.Services; using Abp.Application.Services.Dto; using Abp.AutoMapper; using BCITS.BsmartWater.Storage; using Abp.Domain.Repositories; using Abp.Collections.Extensions; using Abp.Linq.Extensions; using System.Collections.Generic; using System.Linq;
namespace BCITS.BsmartWater { public interface IPersonAppService : IApplicationService { ListResultOutput<PersonListDto> GetPeople(GetPeopleInput input); } public class GetPeopleInput : IInputDto { public string Filter { get; set; } }
[AutoMapFrom(typeof(Person))]
public class PersonListDto : FullAuditedEntityDto
{
public string Name { get; set; }
public string Surname { get; set; }
public string EmailAddress { get; set; }
}
public class PersonAppService : BsmartWaterAppServiceBase, IPersonAppService
{
private readonly IRepository<Person> _personRepository;
public PersonAppService(IRepository<Person> personRepository)
{
_personRepository = personRepository;
}
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<PersonListDto>(persons.MapTo<List<PersonListDto>>());
}
}
}
The text i mentioned in bold is getting error. Please help out asap.
The code given in ASPNETZERO which is [Table("PbPersons")] public class Person : FullAuditedEntity { public const int MaxNameLength = 32; public const int MaxSurnameLength = 32; public const int MaxEmailAddressLength = 255;
[Required]
[MaxLength(MaxNameLength)]
public virtual string Name { get; set; }
[Required]
[MaxLength(MaxSurnameLength)]
public virtual string Surname { get; set; }
[MaxLength(MaxEmailAddressLength)]
public virtual string EmailAddress { get; set; }
}
asked to add .core (domain) project. In which file i need to add and
public partial class Added_Persons_Table : DbMigration { public override void Up() { CreateTable( "dbo.PbPersons", c => new { Id = c.Int(nullable: false, identity: true), Name = c.String(nullable: false, maxLength: 32), Surname = c.String(nullable: false, maxLength: 32), EmailAddress = c.String(maxLength: 255), IsDeleted = c.Boolean(nullable: false), DeleterUserId = c.Long(), DeletionTime = c.DateTime(), LastModificationTime = c.DateTime(), LastModifierUserId = c.Long(), CreationTime = c.DateTime(nullable: false), CreatorUserId = c.Long(), }, annotations: new Dictionary<string, object> { { "DynamicFilter_Person_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" }, }) .PrimaryKey(t => t.Id);
}
public override void Down()
{
DropTable("dbo.PbPersons",
removedAnnotations: new Dictionary<string, object>
{
{ "DynamicFilter_Person_SoftDelete", "EntityFramework.DynamicFilters.DynamicFilterDefinition" },
});
}
}
where i need to add this. Please help me out