tx
2025-04-10 2538101febc78f525945da72c7cdcb2589f9e6ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Collections.Generic;
using System.Linq;
 
namespace TProduct.BLL
{
    public partial class LoginUser
    {
        //Entity to Model
        private TProduct.Model.LoginUser Entity2Model(TProduct.Entity.LoginUser entity)
        {
            if (entity == null)
                return default;
            return TProduct.AutoMapperHelper.GetSingle<TProduct.Entity.LoginUser, TProduct.Model.LoginUser>(entity);
        }
        //Entities to Models
        private List<TProduct.Model.LoginUser> Entity2Models(List<TProduct.Entity.LoginUser> entities)
        {
            if (entities == null || entities.Count() < 1)
                return default;
            return TProduct.AutoMapperHelper.GetMultiple<TProduct.Entity.LoginUser, TProduct.Model.LoginUser>(entities);
        }
 
        //Model to Entity
        private TProduct.Entity.LoginUser Model2Entity(TProduct.Model.LoginUser model)
        {
            if (model == null)
                return default;
            return TProduct.AutoMapperHelper.GetSingle<TProduct.Model.LoginUser, TProduct.Entity.LoginUser>(model);
        }
 
        //Models to Entities
        private List<TProduct.Entity.LoginUser> Model2Entities(List<TProduct.Model.LoginUser> models)
        {
            if (models == null || models.Count < 1)
                return default;
            return TProduct.AutoMapperHelper.GetMultiple<TProduct.Model.LoginUser, TProduct.Entity.LoginUser>(models);
        }
 
        //Model to Entity
        private void Model2Entity(TProduct.Model.LoginUser model, TProduct.Entity.LoginUser entity)
        {
            if (model == null || entity == null)
                return;
            TProduct.AutoMapperHelper.Map<TProduct.Model.LoginUser, TProduct.Entity.LoginUser>(model, entity);
        }
    }
}