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 a = response.Data | |
.Select(dto => Mapper.Map<SafeZoneDTO, SafeZone>(dto)) | |
.Select(safeZone => safeZone.Points) | |
.Select(model => new SafeZonePosition { | |
Latitude = model.Latitude, | |
Longitude = model.Longitude, | |
SafeZoneId = safeZone.Id | |
}); | |
foreach (var dto in response.Data) { |
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 SelectLocationMapViewModel(UserWithSafeZonesModel selectedUser, | |
bool enableLocationCountValidation, | |
IWebRequestManager webRequestManager, | |
IAccountService accountService, | |
IFollowMeService followMeService, | |
ILocationService locationService, | |
IDestinationService destinationService, | |
IKeyboardService keyboardService) : | |
this(null, |
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 filterByName = !string.IsNullOrEmpty(command.Search); | |
var friendList = (await repository.GetByFriendStatusAsync(FriendStatus.AlreadyFriend)) | |
.Where(e => command.FriendTypes.Contains(e.FriendType)) | |
.Take(command.PageSize); | |
if (filterByName) { | |
userFriends.Data = friendList.Where(e => e.FullName.Contains(command.Search)).ToList(); | |
} |
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
void LocationChanged(object sender, PositionEventArgs e) | |
{ | |
if (stopWatch == null) { | |
stopWatch = Stopwatch.StartNew(); | |
} | |
var position = e.Position; | |
if (UnixTimeStamp > previousUpdateTime + MinUpdateTime) { | |
stopWatch.Stop(); | |
Log("location: ({0}, {1}), lapsed time: {2}", position.Latitude, position.Longitude, stopWatch.ElapsedMilliseconds); | |
previousUpdateTime = UnixTimeStamp; |
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
@Query("SELECT id, title, description, dateCreated, certificateLink, deliveryStatus, userId\n" + | |
"FROM Certificates\n" + | |
"WHERE userId = :userId\n" + | |
"ORDER BY expirationDate") | |
List<CertificateDto> getAllNotifications(long userId); | |
@Query("SELECT id, title, description, dateCreated, certificateLink, deliveryStatus, userId\n" + | |
"FROM Certificates\n" + | |
"WHERE userId = :userId AND\n" + | |
" expirationDate <= date('now', '+8 hour') AND -- TODO: get client timezone from header\n" + |
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
@Entity(tableName = "Certificates", | |
foreignKeys = @ForeignKey( | |
entity = UserDto.class, | |
parentColumns = "id", | |
childColumns = "userId", | |
onUpdate = ForeignKey.SET_NULL, | |
onDelete = ForeignKey.SET_NULL)) | |
public class CertificateDto { | |
@PrimaryKey |
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
{ | |
"formatVersion": 1, | |
"database": { | |
"version": 1, | |
"identityHash": "f0cd29d11d4a03881fedffb2c12feb23", | |
"entities": [ | |
{ | |
"tableName": "Certificates", | |
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `userId` INTEGER NOT NULL, `title` TEXT, `description` TEXT, `dateCreated` TEXT, `expirationDate` TEXT, `certificateLink` TEXT, `deliveryStatus` INTEGER, PRIMARY KEY(`id`), FOREIGN KEY(`userId`) REFERENCES `Users`(`id`) ON UPDATE SET NULL ON DELETE SET NULL )", | |
"fields": [ |
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
{ | |
"status": "success/error", | |
"data": object/array | |
} |
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
class Test { | |
CancellationTokenSource cts; | |
async void DoSomething() { | |
var i = 0; | |
while (i < 10) { | |
i = i + 1; |
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 class PermissionGroup : ObservableCollection<Permission> | |
{ | |
string _groupName; | |
public string GroupName { | |
get => _groupName; | |
set => SetPropertyChanged(ref _groupName, value); | |
} | |
public PermissionGroup(string groupName) | |
{ | |
GroupName = groupName; |