Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Cannot implicitly convert type 'System.Collections.Generic.List

$
0
0

This is my class 

public class ClinicCoreRepository : IClinicCoreRepository
    {
        private readonly ArtCoreDbContext context;
        public ClinicCoreRepository(ArtCoreDbContext context)
        {
            this.context = context;

        }

        public async Task<PartnersRegistry> GetPatientPartnerList(long Id)
        {
            var patient = await context.PartnersRegistry
            .Where(pt => pt.PatientFileId == Id)
            .Select(pt => new PartnersRegistryResource
            {
                PartnerFileId = pt.PartnerFileId
            }).ToListAsync();
            return patient;

        }
    }

I am trying to return a list through this method but I keep getting
Cannot implicitly convert type 'System.Collections.Generic.List<ArtCore.Controllers.Resources.ClinicCoreResources.PartnersRegistryResource>' to 'ArtCore.Core.Models.ClinicCore.PartnersRegistry' [ArtCore]
<div class="grammarly-disable-indicator"></div>

Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>