public static UserPermissionDTO Map(this UserPermission source)
        {
            var target = new UserPermissionDTO();

            target.Id = source.Id;
            target.IdPermission = source.IdPermission;
            target.IdUser = source.IdUser;
            target.LastModifyDate = source.LastModifyDate;

            return target;
        }
        public void TestUserPermissions()
        {
            using (Hobby.SimpleInjector.SimpleInjectorConsole.Instance.BeginLifetimeScope())
            {
                var uow = IoCCProvider.Container.GetInstance<IUnitOfWork>();

                var categorie = new CategoryDTO
                {
                    Name = "testCategorie1"
                };

                var permissions = new PermissionDTO
                {
                    Name = "testPermission1",
                    Deleted = false,
                    Description = "TEST"
                };

                var user = new UserDTO
                {
                    FirstName = "testlogin1",
                    Password = "******"
                };
                //Trzeba przypsiac do obiektu
                var entityPer = permissions.Map();
                var entityUse = user.Map();

                uow.Permissions.Add(entityPer);
                uow.Users.Add(entityUse);
                uow.Save();

                var userPermission = new UserPermissionDTO()
                {
                    IdPermission = entityPer.Id,
                    IdUser = entityUse.Id
                };
                uow.UserPermissions.Add(userPermission.Map());
                uow.Save();
            }
        }