using Microsoft.EntityFrameworkCore.Metadata;
using PhoneToolMX.Models.ViewModels;
using System.ComponentModel.DataAnnotations;

namespace PhoneToolMX.Models
{
    public class OwnedBase : IOwnedModel
    {
        public int? Id { get; set; }
        public ICollection<User> Owners { get; set; }
        
        public bool IsOwnedBy(User user)
        {
            return (Owners != null && Owners.Any(o => o.Id == user.Id));
        }
    }
}