This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Crear una branch nueva desde branch base | |
git checkout branchBase (para pararse en la branch deseada) | |
git checkout -b branchNueva (para crear la nueva a partir de la base) | |
2) Subir cambios al branch remoto | |
git add . (Agrega todos los cambios en el local) | |
*También, si no estás todavía muy cómodo con git podes usar el siguiente comando: | |
git add -p (este te permite ver lo que vas a agregar) | |
git commit -m "Mensaje” (genera un paquete con los cambios para enviar al remoto) | |
git push origin branchNombre (envia el contenido del commit al branch remoto) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Route("[controller]")] | |
public class RoutingController : Controller | |
{ | |
private readonly IUnitOfWork _unitOfWork; | |
private readonly IHtmlLocalizer<RoutingController> _localizer; | |
public RoutingController(IUnitOfWork unitOfWork, IHtmlLocalizer<RoutingController> localizer) | |
{ | |
this._unitOfWork = unitOfWork; | |
this._localizer = localizer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keywords = new List<Tuple<int, string>>(); | |
foreach(var obj in response) | |
{ | |
var tuple = new Tuple<int, string>(Convert.ToInt32(obj), obj.ToString()); | |
keywords.Add(tuple); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keywords = response.Select(obj => | |
new Tuple<int,string>(Convert.ToInt32(obj), obj.ToString()) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using Project.Repositories.Interfaces; | |
using Microsoft.EntityFrameworkCore; | |
namespace Project.Repositories | |
{ | |
public class Repository<T> : IRepository<T> where T : class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using Project.Repositories.Interfaces; | |
using Microsoft.EntityFrameworkCore; | |
namespace Project.Repositories | |
{ | |
public class Repository<T> : IRepository<T> where T : class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using EduitorNetCore.Models.Database; | |
using EduitorNetCore.Models.VOs.Reduceds; | |
using EduitorNetCore.Repositories.Database; | |
using EduitorNetCore.Repositories.Interfaces; | |
using Microsoft.EntityFrameworkCore; | |
namespace EduitorNetCore.Repositories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<IActionResult> CategoryMetric(string startingDate, int? schoolId) | |
{ | |
var currentUser = (await UserManager.FindByEmailAsync(User.Identity.Name)); | |
try | |
{ | |
if (GetSchoolToSearch(currentUser, schoolId) == null && !currentUser.IsInRole("Admin")) | |
return BadRequest(Localizer["UserIsNotSchoolGroupAdmin"]); | |
return Ok(GetSchoolGroupAccesedResources(schoolId, | |
currentUser.SchoolGroup, DateTime.ParseExact(startingDate, | |
"dd/MM/yyyy", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IEnumerable<Resource> GetSchoolGroupAccesedResources(int? schoolId, SchoolGroup schoolGroup, DateTime startingDate) | |
{ | |
var schoolGroupResources = schoolGroup | |
.SchoolGroupPrograms | |
.SelectMany(sgp => sgp.EducationalProgram.EducationalProgramResources) | |
.Select(epr => epr.Resource) | |
.Where(r => r.UpdatedAt > startingDate); | |
IEnumerable<int> schoolUserIds = null; | |
if (schooId != null) | |
schoolUserIds = school.Teachers.Select(t => t.TeacherId).Concat(school.Managers.Select(m => m.ManagerId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] | |
[HttpGet("AllResourceCategoryMetric")] | |
public IActionResult ResourceCategoryMetric(string startingDate) | |
{ | |
// TODO: roles not implemented yed, this metric is returns the same metric for any role | |
if (startingDate == string.Empty) | |
return BadRequest(Localizer["SelectATimePeriod"]); | |
var resources = UnitOfWork.ResourceRepository.GetAllWithRelatedEntitites().Where(ra => | |
ra.UpdatedAt >= DateTime.ParseExact(startingDate, "dd/MM/yyyy", CultureInfo.InvariantCulture)) | |
.ToList(); |